@orangelogic/design-system 4.53.0 → 4.55.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/chunks/{alert.C7jo45Pq.js → alert.2Esbser8.js} +2 -2
- package/library/chunks/{array-line-clamp.DKxxZlon.js → array-line-clamp.sxTWf9Iz.js} +2 -2
- package/library/chunks/{asset-link-format.B_gS4nTL.js → asset-link-format.b1PRwN5q.js} +493 -454
- package/library/chunks/{audio.C8rPv9iZ.js → audio.B0VfXBIx.js} +2 -2
- package/library/chunks/{bicolor-picker.DrQWK6-q.js → bicolor-picker.BEs23Gs0.js} +1 -1
- package/library/chunks/{block-width.-jEx3KZ4.js → block-width.5rlxqu64.js} +46 -46
- package/library/chunks/{border-input-group.PiWnqlx7.js → border-input-group.dw1516Kf.js} +3 -3
- package/library/chunks/{breadcrumb.BLCAOe89.js → breadcrumb.DkINVxcJ.js} +1 -1
- package/library/chunks/{button.DnOMjl_G.js → button.BjijpxeK.js} +3 -3
- package/library/chunks/{checkbox.aFoOxk2j.js → checkbox.BdSpQlwf.js} +1 -1
- package/library/chunks/{color-picker.DkVQou0p.js → color-picker.D38VZ1JB.js} +11 -11
- package/library/chunks/{color-swatch-group.C85bEtP3.js → color-swatch-group.D4cJJmvA.js} +36 -36
- package/library/chunks/{color-swatch.Biz89VJr.js → color-swatch.PNkiDQx5.js} +3 -3
- package/library/chunks/{config-manager.Cc9QkEey.js → config-manager.CVYMQ0tt.js} +33 -33
- package/library/chunks/{configs-controller.DBzBhYjU.js → configs-controller.0FoXQnJn.js} +20 -20
- package/library/chunks/{confirm-popover.DpVrPWXU.js → confirm-popover.BHKVBESN.js} +4 -4
- package/library/chunks/{copy-button.CSUoVbip.js → copy-button.CQO3gEFh.js} +2 -2
- package/library/chunks/{corner-position-input-group.vhSOueRn.js → corner-position-input-group.BzYJD8zG.js} +4 -4
- package/library/chunks/{date-calendar.BpfgvrtE.js → date-calendar.B7e6WBzh.js} +1 -1
- package/library/chunks/{details.BGlfx87d.js → details.DSgp6VAD.js} +1 -1
- package/library/chunks/{dialog.DprCsbFG.js → dialog.QENKQ3wO.js} +3 -3
- package/library/chunks/{diff.DZjfy2VU.js → diff.Bmdpmpvo.js} +1 -1
- package/library/chunks/{document-viewer.BRJqmyum.js → document-viewer.CSSI__TI.js} +14 -14
- package/library/chunks/{dom.BsVeSE01.js → dom.BLHsooDR.js} +1 -1
- package/library/chunks/{dot-pagination.CfK67Z-x.js → dot-pagination.8huF7K9E.js} +2 -2
- package/library/chunks/{drawer.Ba0CKg86.js → drawer.CLSdjLR9.js} +2 -2
- package/library/chunks/{dropdown.CKad9CvP.js → dropdown.BTQ07f9L.js} +5 -5
- package/library/chunks/{dynamic-select.DmTXLyzH.js → dynamic-select.BEKv0lpx.js} +5 -5
- package/library/chunks/{e-chart.BkqfNGfV.js → e-chart.DKFAToIc.js} +2 -2
- package/library/chunks/{element-clamp.CwFlUOET.js → element-clamp.DSKvP36j.js} +2 -2
- package/library/chunks/{file-on-demand.Cuj5wcYW.js → file-on-demand.DNVrOUTH.js} +17 -17
- package/library/chunks/{folder-select.DpQEZDg1.js → folder-select.B16qEGcG.js} +16 -16
- package/library/chunks/{form.JYXtmwQ2.js → form.D_eBa3AQ.js} +1 -1
- package/library/chunks/{format-time.ysWqJKLC.js → format-time.QkJcKYrT.js} +1 -1
- package/library/chunks/{header.CD4B3ylz.js → header.B11-tX9H.js} +2 -2
- package/library/chunks/{i18n.CQPiI18Q.js → i18n.Bjg2ubA4.js} +2 -1
- package/library/chunks/{icon-button.BAUsYiQh.js → icon-button.qJd_az6T.js} +2 -2
- package/library/chunks/{iframe.CKoHB0lA.js → iframe.sl2wnUcC.js} +1 -1
- package/library/chunks/{image-comparer.WUKRGHqI.js → image-comparer.BCD6kzLm.js} +1 -1
- package/library/chunks/{image.C6-Opjew.js → image.alhsAc_i.js} +2 -2
- package/library/chunks/{input.D1UkXp3F.js → input.kTjqEyC8.js} +2 -2
- package/library/chunks/{line-clamp.COXyDBRB.js → line-clamp.BYoTFCvo.js} +2 -2
- package/library/chunks/{markdown.CgWP0X61.js → markdown.BzDRvv-f.js} +3 -3
- package/library/chunks/{masonry.4Lcy37gf.js → masonry.B8EOiLu0.js} +3 -3
- package/library/chunks/{menu-item.CCbtHE5R.js → menu-item.Z7pkEEyC.js} +3 -3
- package/library/chunks/{menu.DNeN3pz0.js → menu.Dlt4EsSJ.js} +2 -2
- package/library/chunks/option.DWE0tark.js +136 -0
- package/library/chunks/{padding-input-group.CGDq3Cct.js → padding-input-group.B-hbA7P2.js} +1 -1
- package/library/chunks/{pagination.Mr-XiQBd.js → pagination.ATa3enAG.js} +7 -7
- package/library/chunks/{popup.yll4fQau.js → popup.LaRE0W3Q.js} +1 -1
- package/library/chunks/{position-picker.DzRyAx7a.js → position-picker.X2hhfGx7.js} +2 -2
- package/library/chunks/{progress-bar.BfHPsueW.js → progress-bar.CynVLLnY.js} +1 -1
- package/library/chunks/{progress-ring.Cn08Dbar.js → progress-ring.Bfdj3-uB.js} +1 -1
- package/library/chunks/{radio-card.jROctGtI.js → radio-card.BVkRnAT5.js} +1 -1
- package/library/chunks/{radio-group.DSnDDjKe.js → radio-group.CHlxPcrs.js} +1 -1
- package/library/chunks/{range.CQzHuhd9.js → range.BWrWIE6S.js} +3 -3
- package/library/chunks/{rating.BjGQtyCk.js → rating.CNeNn996.js} +1 -1
- package/library/chunks/{relative-time.BcpFkSZT.js → relative-time.BfE3UOhF.js} +1 -1
- package/library/chunks/{select.CEgt2ciT.js → select.DJSXKV7u.js} +154 -102
- package/library/chunks/{shadow-input-group.C13mC7rW.js → shadow-input-group.B_06ZQpb.js} +2 -2
- package/library/chunks/{share-option-list.CdQeYk-I.js → share-option-list.BetSdhgh.js} +3 -3
- package/library/chunks/sidebar.CiZOJ49X.js +120 -0
- package/library/chunks/{size-input-group.DtldCuqS.js → size-input-group.VZ4Yt8qW.js} +5 -5
- package/library/chunks/{spinner.DsWszid8.js → spinner.Bv06U7NJ.js} +1 -1
- package/library/chunks/{split-panel.KzmC5IAW.js → split-panel.Cag0lAvv.js} +1 -1
- package/library/chunks/src.CQ2H22mE.js +103 -0
- package/library/chunks/{src.BJpSLSUr.js → src.CgqvT9Zj.js} +4 -4
- package/library/chunks/{step.BlnWLzqI.js → step.CA3PQN8l.js} +3 -3
- package/library/chunks/{stepper-wizard.t7enm9Uz.js → stepper-wizard.B72l6S-I.js} +2 -2
- package/library/chunks/{stepper.DzhUPTLW.js → stepper.DgoOS-k1.js} +1 -1
- package/library/chunks/{string.DAuTpyw8.js → string.9yahdkB8.js} +39 -1
- package/library/chunks/{switch.CBho2RVW.js → switch.BM9msK5T.js} +1 -1
- package/library/chunks/{tab-group.BSdtDqou.js → tab-group.DhX_Aowk.js} +8 -8
- package/library/chunks/{tab.C0oUx7MY.js → tab.vGimW19a.js} +3 -3
- package/library/chunks/{tag.B2S21_nF.js → tag.Dr7Na8Kf.js} +3 -3
- package/library/chunks/{textarea.BgWdR_7D.js → textarea.CHSZI8vt.js} +1 -1
- package/library/chunks/{timecode.DME2imtx.js → timecode.DjI1OTXD.js} +1 -1
- package/library/chunks/{tooltip.DJl5qcTx.js → tooltip.BpXJhnhh.js} +2 -2
- package/library/chunks/{tree.CnEAk97A.js → tree.BEdI81wd.js} +12 -6
- package/library/chunks/{typeface.Dr9m4SZE.js → typeface.CDjUSIt9.js} +3 -3
- package/library/chunks/{video.bGH-n4pZ.js → video.Dbzi5Pxz.js} +3 -3
- package/library/components/alert.js +1 -1
- package/library/components/array-line-clamp.js +1 -1
- package/library/components/asset-link-format.js +1 -1
- package/library/components/atoms.js +55 -55
- package/library/components/audio.js +1 -1
- package/library/components/bicolor-picker.js +1 -1
- package/library/components/border-input-group.js +1 -1
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +1 -1
- package/library/components/checkbox.js +1 -1
- package/library/components/color-picker.js +1 -1
- package/library/components/color-swatch-group.js +1 -1
- package/library/components/color-swatch.js +1 -1
- package/library/components/confirm-popover.js +1 -1
- package/library/components/copy-button.js +1 -1
- package/library/components/corner-position-input-group.js +1 -1
- package/library/components/date-calendar.js +1 -1
- package/library/components/details.js +1 -1
- package/library/components/dialog.js +1 -1
- package/library/components/diff.js +1 -1
- package/library/components/document-viewer.js +1 -1
- package/library/components/dot-pagination.js +1 -1
- package/library/components/drawer.js +1 -1
- package/library/components/dropdown.js +1 -1
- package/library/components/dynamic-select.js +1 -1
- package/library/components/e-chart.js +1 -1
- package/library/components/element-clamp.js +1 -1
- package/library/components/file-on-demand.js +1 -1
- package/library/components/folder-select.js +1 -1
- 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 +1 -1
- package/library/components/header.js +1 -1
- package/library/components/icon-button.js +1 -1
- package/library/components/iframe.js +1 -1
- package/library/components/image-comparer.js +1 -1
- package/library/components/image.js +1 -1
- package/library/components/input.js +1 -1
- package/library/components/line-clamp.js +1 -1
- package/library/components/markdown.js +1 -1
- package/library/components/masonry.js +1 -1
- package/library/components/menu-item.js +1 -1
- package/library/components/menu.js +1 -1
- package/library/components/molecules.js +16 -16
- package/library/components/option.js +1 -1
- package/library/components/organisms.js +3 -3
- package/library/components/padding-input-group.js +1 -1
- package/library/components/pagination.js +1 -1
- 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/radio-card.js +1 -1
- package/library/components/radio-group.js +1 -1
- package/library/components/range.js +1 -1
- package/library/components/rating.js +1 -1
- package/library/components/relative-time.js +1 -1
- package/library/components/select.js +1 -1
- package/library/components/shadow-input-group.js +1 -1
- package/library/components/share-option-list.js +1 -1
- package/library/components/sidebar.js +1 -1
- package/library/components/size-input-group.js +1 -1
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +1 -1
- 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 +1 -1
- package/library/components/tab-group.js +1 -1
- package/library/components/tab.js +1 -1
- package/library/components/tag.js +1 -1
- package/library/components/textarea.js +1 -1
- package/library/components/timecode.js +1 -1
- package/library/components/tooltip.js +1 -1
- package/library/components/tree-item.js +1 -1
- package/library/components/tree.js +1 -1
- package/library/components/typeface.js +1 -1
- package/library/components/types.js +12634 -12634
- package/library/components/video.js +1 -1
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/option/option.d.ts +15 -2
- package/library/packages/atoms/src/components/select/select.d.ts +23 -2
- package/library/packages/molecules/src/sidebar/sidebar.d.ts +16 -2
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +5 -0
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-crop/asset-link-format-crop.d.ts +13 -0
- package/library/packages/types/src/sidebar.d.ts +2 -0
- package/library/packages/utils/src/custom-element/i18n.d.ts +1 -0
- package/library/packages/utils/src/string/string.d.ts +20 -0
- package/library/react-web-component.d.ts +22 -2
- package/library/utils.js +27 -27
- package/package.json +1 -1
- package/library/chunks/option.Da60zYvc.js +0 -100
- package/library/chunks/sidebar.CwAW3KaC.js +0 -100
- package/library/chunks/src.CYwPx1Vw.js +0 -103
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../chunks/video.
|
|
1
|
+
import { n as e, t } from "../chunks/video.Dbzi5Pxz.js";
|
|
2
2
|
export { t as VIDEO_BACKGROUND_SIZE_BY_OBJECT_FIT, e as default };
|
package/library/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as CortexElement } from '../../../../base/src/cortex-element.ts';
|
|
2
2
|
import { CheckPlacement } from '../../../../types/src/option';
|
|
3
|
-
import {
|
|
3
|
+
import { TextMatchRange } from '../../../../utils/src/string';
|
|
4
|
+
import { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
4
5
|
import { default as CxIcon } from '../icon/icon';
|
|
5
6
|
import { default as CxSpace } from '../space/space';
|
|
6
7
|
/**
|
|
@@ -14,6 +15,8 @@ import { default as CxSpace } from '../space/space';
|
|
|
14
15
|
* @csspart checked-icon - The checked icon, an `<cx-icon>` element.
|
|
15
16
|
* @csspart base - The component's base wrapper.
|
|
16
17
|
* @csspart label - The option's label.
|
|
18
|
+
* @csspart match - Each part of a plain-text label that matches the query of a `cx-select` with `highlight-matches`,
|
|
19
|
+
* a `<mark>` element. Restyle it with `cx-option::part(match)`.
|
|
17
20
|
* @csspart prefix - The container that wraps the prefix.
|
|
18
21
|
* @csspart suffix - The container that wraps the suffix.
|
|
19
22
|
*
|
|
@@ -28,6 +31,7 @@ import { default as CxSpace } from '../space/space';
|
|
|
28
31
|
* @cssproperty [--cx-menu-item-background-color-hover=var(--cx-color-primary-50)] - Background color of the hovered option and of the current option. Dark theme: `var(--cx-color-neutral-100)`.
|
|
29
32
|
*/
|
|
30
33
|
export default class CxOption extends CortexElement {
|
|
34
|
+
#private;
|
|
31
35
|
static styles: CSSResultGroup;
|
|
32
36
|
static dependencies: {
|
|
33
37
|
'cx-icon': typeof CxIcon;
|
|
@@ -51,6 +55,15 @@ export default class CxOption extends CortexElement {
|
|
|
51
55
|
showCheck: boolean;
|
|
52
56
|
/** Check icon placement */
|
|
53
57
|
checkPlacement: CheckPlacement;
|
|
58
|
+
/**
|
|
59
|
+
* The `[start, end)` ranges of the text label (see `getTextLabel()`) that match the parent control's query, in order
|
|
60
|
+
* and without overlap. Set by `cx-select` when `highlight-matches` is enabled. Each range is rendered in a `match`
|
|
61
|
+
* part only when the label is plain text and every range fits inside it; otherwise the label is shown as is.
|
|
62
|
+
*/
|
|
63
|
+
matchRanges: TextMatchRange[];
|
|
64
|
+
connectedCallback(): void;
|
|
65
|
+
disconnectedCallback(): void;
|
|
66
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
54
67
|
runFirstUpdated(): void;
|
|
55
68
|
private handleDefaultSlotChange;
|
|
56
69
|
private handleMouseEnter;
|
|
@@ -60,7 +73,7 @@ export default class CxOption extends CortexElement {
|
|
|
60
73
|
handleValueChange(): void;
|
|
61
74
|
/** Returns a plain text label based on the option's content. */
|
|
62
75
|
getTextLabel(): string;
|
|
63
|
-
render():
|
|
76
|
+
render(): TemplateResult<1>;
|
|
64
77
|
}
|
|
65
78
|
declare global {
|
|
66
79
|
interface HTMLElementTagNameMap {
|
|
@@ -219,9 +219,10 @@ export default class CxSelect extends CortexElement implements CortexFormControl
|
|
|
219
219
|
label: string;
|
|
220
220
|
/**
|
|
221
221
|
* The preferred placement of the select's menu. Note that the actual placement may vary as needed to keep the listbox
|
|
222
|
-
* inside of the viewport.
|
|
222
|
+
* inside of the viewport. The `-start` variants align the listbox with the start edge of the select instead of
|
|
223
|
+
* centering it, which matters with `free-width`.
|
|
223
224
|
*/
|
|
224
|
-
placement: 'top' | 'bottom';
|
|
225
|
+
placement: 'top' | 'top-start' | 'bottom' | 'bottom-start';
|
|
225
226
|
/**
|
|
226
227
|
* The select's help text. If you need to display HTML, use the `help-text` slot instead.
|
|
227
228
|
*/
|
|
@@ -253,6 +254,10 @@ export default class CxSelect extends CortexElement implements CortexFormControl
|
|
|
253
254
|
* When set to true, the select will not show the dropdown.
|
|
254
255
|
*/
|
|
255
256
|
noDropdown: boolean;
|
|
257
|
+
/**
|
|
258
|
+
* When set to true, the expand icon is not rendered, e.g. when the select is used as a search box.
|
|
259
|
+
*/
|
|
260
|
+
noExpandIcon: boolean;
|
|
256
261
|
/**
|
|
257
262
|
* When set to true, the select will show a loading spinner.
|
|
258
263
|
*/
|
|
@@ -271,6 +276,22 @@ export default class CxSelect extends CortexElement implements CortexFormControl
|
|
|
271
276
|
* 'none' : does not do anything, the user cannot type
|
|
272
277
|
*/
|
|
273
278
|
inputBehavior: 'select' | 'filter' | 'none';
|
|
279
|
+
/**
|
|
280
|
+
* When set to true, the default `filterCallback` ignores accents and diacritics, so typing `cai dat` matches
|
|
281
|
+
* `Cài đặt`. Has no effect when `filterCallback` is overridden.
|
|
282
|
+
*/
|
|
283
|
+
filterIgnoreAccents: boolean;
|
|
284
|
+
/**
|
|
285
|
+
* When set to true and `input-behavior` is `filter`, every match of the typed query inside each visible
|
|
286
|
+
* `<cx-option>`'s plain-text label is wrapped in the option's `match` part (bold by default).
|
|
287
|
+
* Options whose label contains elements are shown without a highlight.
|
|
288
|
+
*/
|
|
289
|
+
highlightMatches: boolean;
|
|
290
|
+
/**
|
|
291
|
+
* The minimum number of typed characters before the listbox can open. Below it, clicking, typing and the
|
|
292
|
+
* keyboard do not open the listbox, and an open listbox closes. Set to 0 to open without typing.
|
|
293
|
+
*/
|
|
294
|
+
minQueryLength: number;
|
|
274
295
|
/**
|
|
275
296
|
* A function that returns the value of an option. This is used to determine the value of the select when an option is selected.
|
|
276
297
|
*
|
|
@@ -3,9 +3,9 @@ import { default as CxIcon } from '../../../atoms/src/components/icon/icon.ts';
|
|
|
3
3
|
import { default as CxIconButton } from '../../../atoms/src/components/icon-button/icon-button.ts';
|
|
4
4
|
import { default as CxResizeObserver } from '../../../atoms/src/components/resize-observer/resize-observer.ts';
|
|
5
5
|
import { default as CortexElement } from '../../../base/src/cortex-element.ts';
|
|
6
|
-
import { SidebarLocation } from '../../../types/src/sidebar';
|
|
6
|
+
import { SidebarCloseTriggerPlacement, SidebarLocation } from '../../../types/src/sidebar';
|
|
7
7
|
import { HasSlotController } from '../../../utils/src/custom-element/slot';
|
|
8
|
-
import { CSSResultGroup } from 'lit';
|
|
8
|
+
import { CSSResultGroup, PropertyValues } from 'lit';
|
|
9
9
|
export type CxAfterResizeEvent = CustomEvent<{
|
|
10
10
|
/**
|
|
11
11
|
* Side of the sidebar
|
|
@@ -29,12 +29,18 @@ declare global {
|
|
|
29
29
|
* @slot open_trigger - The label of the open trigger.
|
|
30
30
|
*
|
|
31
31
|
* @event cx-after-resize {{ side: 'left' | 'right', size: number }} - Emitted after the sidebar is resized.
|
|
32
|
+
* @event cx-show - Emitted when the sidebar opens (after the first render).
|
|
33
|
+
* @event cx-hide - Emitted when the sidebar closes (after the first render).
|
|
34
|
+
*
|
|
35
|
+
* @cssproperty --open-trigger-padding - Padding of the open trigger shown while collapsed. Defaults to
|
|
36
|
+
* `var(--cx-spacing-medium)`; reduce it when `--closed-width` is too narrow for the trigger content.
|
|
32
37
|
*
|
|
33
38
|
* @csspart base - The component's base wrapper.
|
|
34
39
|
* @csspart header - The container that wraps the header.
|
|
35
40
|
* @csspart content - The container that wraps the main content.
|
|
36
41
|
*/
|
|
37
42
|
export default class CxSidebar extends CortexElement {
|
|
43
|
+
#private;
|
|
38
44
|
static styles: CSSResultGroup;
|
|
39
45
|
static dependencies: {
|
|
40
46
|
'cx-divider': typeof CxDivider;
|
|
@@ -43,10 +49,16 @@ export default class CxSidebar extends CortexElement {
|
|
|
43
49
|
'cx-resize-observer': typeof CxResizeObserver;
|
|
44
50
|
};
|
|
45
51
|
header: HTMLElement;
|
|
52
|
+
openTrigger: HTMLElement | null;
|
|
46
53
|
/**
|
|
47
54
|
* Sets the side for the component.
|
|
48
55
|
*/
|
|
49
56
|
side: SidebarLocation;
|
|
57
|
+
/**
|
|
58
|
+
* Where the close trigger sits along the sidebar's inner edge: `start` (top), `center` or `end` (bottom). Move it
|
|
59
|
+
* away from `start` when the top of the content holds a full-width control the trigger would overlap.
|
|
60
|
+
*/
|
|
61
|
+
closeTriggerPlacement: SidebarCloseTriggerPlacement;
|
|
50
62
|
/**
|
|
51
63
|
* Is the sidebar open?
|
|
52
64
|
*/
|
|
@@ -72,6 +84,8 @@ export default class CxSidebar extends CortexElement {
|
|
|
72
84
|
handleCollapsibleChange(): void;
|
|
73
85
|
constructor();
|
|
74
86
|
connectedCallback(): void;
|
|
87
|
+
protected willUpdate(changedProperties: PropertyValues<this>): void;
|
|
88
|
+
protected updated(changedProperties: PropertyValues<this>): void;
|
|
75
89
|
private handleDrag;
|
|
76
90
|
private handleSizeChange;
|
|
77
91
|
private handleResize;
|
|
@@ -365,6 +365,11 @@ export default class CxAssetLinkFormat extends CortexElement {
|
|
|
365
365
|
* Without an asset, the largest crop the image can take; Infinity when unknown.
|
|
366
366
|
*/
|
|
367
367
|
private get cropMaxSize();
|
|
368
|
+
/**
|
|
369
|
+
* Whether the pixel crop has reached a side of `cropMaxSize` that a Dimensions step above it sets.
|
|
370
|
+
* A side Dimensions does not lower, such as one a later pixel Resize sets, does not count.
|
|
371
|
+
*/
|
|
372
|
+
private get isCropAtDimensionsLimit();
|
|
368
373
|
/**
|
|
369
374
|
* Returns the last crop size based on the transformations applied to the asset link.
|
|
370
375
|
* This is calculated by iterating through the transformations and applying the last crop, resize, or rotate transformation to the default size of the asset.
|
|
@@ -49,6 +49,8 @@ export type CxAssetLinkFormatCropPositionChangeEvent = CustomEvent<{
|
|
|
49
49
|
*
|
|
50
50
|
* @property {boolean} no-ratio-modes - When true, hides the ratio mode select (Free, Widescreen, Square, etc.) and the unit select (Pixels / Aspect Ratio).
|
|
51
51
|
* @property {boolean} show-position-picker - When true, shows the position picker grid right after the focus mode select, while `focusMode` is 'manual'.
|
|
52
|
+
* @property {boolean} has-cropper - When true, a cropper draws the crop as a frame over the asset, and a unit switch keeps that frame.
|
|
53
|
+
* @property {boolean} dimensions-limited - When true, notes under the size inputs that Dimensions limits the crop to `max-width` x `max-height`.
|
|
52
54
|
* @property {boolean} inline - When true, keeps the controls visible without an accordion header or Apply button.
|
|
53
55
|
* @property {string} position - The selected anchor position from the position picker (e.g. top-left, center-center).
|
|
54
56
|
*/
|
|
@@ -148,6 +150,16 @@ export default class CxAssetLinkFormatCrop extends CortexElement {
|
|
|
148
150
|
* `focusMode` is 'manual'.
|
|
149
151
|
*/
|
|
150
152
|
showPositionPicker: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Whether a cropper draws this crop as a frame over the asset (Share/embed). A unit switch then keeps
|
|
155
|
+
* that frame: the same box shown in the other unit, with the mode and the link as they are.
|
|
156
|
+
*/
|
|
157
|
+
hasCropper: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Whether the pixel crop has reached a side of `maxWidth` x `maxHeight` that Dimensions sets. Shows a
|
|
160
|
+
* note with that size under the size inputs.
|
|
161
|
+
*/
|
|
162
|
+
dimensionsLimited: boolean;
|
|
151
163
|
/**
|
|
152
164
|
* The last applied crop settings for each unit.
|
|
153
165
|
* This is used to restore the last applied settings when the component is closed.
|
|
@@ -219,6 +231,7 @@ export default class CxAssetLinkFormatCrop extends CortexElement {
|
|
|
219
231
|
private onPositionChange;
|
|
220
232
|
/**
|
|
221
233
|
* Handles the change of the unit of measurement for the crop settings.
|
|
234
|
+
* With a cropper the frame stays as it is, shown in the new unit (the host turns an auto mode to Free).
|
|
222
235
|
* Inline (every change is saved) carries the crop over to the new unit and keeps the mode, unless it
|
|
223
236
|
* is an auto mode. Otherwise it emits the last applied settings for the new unit and resets the mode
|
|
224
237
|
* to Free.
|
|
@@ -295,6 +295,7 @@ export interface Translation extends DefaultTranslation {
|
|
|
295
295
|
createTransition: string;
|
|
296
296
|
crop: string;
|
|
297
297
|
cropFocus: string;
|
|
298
|
+
cropLimitedByDimensions: (width: number, height: number) => string;
|
|
298
299
|
cropStyle: string;
|
|
299
300
|
cubic: string;
|
|
300
301
|
currentPage: string;
|
|
@@ -164,3 +164,23 @@ export declare function unescapeXML(value: string): string;
|
|
|
164
164
|
export declare function getAttributesString(attributes?: {
|
|
165
165
|
[id: string]: string;
|
|
166
166
|
}): string;
|
|
167
|
+
/** A `[start, end)` range of UTF-16 indices into a string. */
|
|
168
|
+
export interface TextMatchRange {
|
|
169
|
+
end: number;
|
|
170
|
+
start: number;
|
|
171
|
+
}
|
|
172
|
+
export interface SearchTextOptions {
|
|
173
|
+
/** Also strip diacritics so `cai dat` matches `Cài đặt`. */
|
|
174
|
+
ignoreAccents?: boolean;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Lowercases `text` for case-insensitive search. With `ignoreAccents`, it also decomposes the text (NFD), strips
|
|
178
|
+
* combining marks and maps `đ`/`Đ` to `d`.
|
|
179
|
+
*/
|
|
180
|
+
export declare function foldSearchText(text: string, { ignoreAccents }?: SearchTextOptions): string;
|
|
181
|
+
/**
|
|
182
|
+
* Finds every occurrence of `query` in `text`, compared with {@link foldSearchText}, and returns their ranges in the
|
|
183
|
+
* original `text`, in order. Occurrences are searched without overlap, and ranges that touch or overlap in the
|
|
184
|
+
* original text are merged. Returns an empty array when `query` is empty or not found.
|
|
185
|
+
*/
|
|
186
|
+
export declare function findSearchMatches(text: string, query: string, { ignoreAccents }?: SearchTextOptions): TextMatchRange[];
|
|
@@ -2059,9 +2059,9 @@
|
|
|
2059
2059
|
*/
|
|
2060
2060
|
label?: string;
|
|
2061
2061
|
/**
|
|
2062
|
-
* The preferred placement of the select's menu. Note that the actual placement may vary as needed to keep the listbox inside of the viewport.
|
|
2062
|
+
* The preferred placement of the select's menu. Note that the actual placement may vary as needed to keep the listbox inside of the viewport. The `-start` variants align the listbox with the start edge of the select instead of centering it, which matters with `free-width`.
|
|
2063
2063
|
*/
|
|
2064
|
-
placement?: "top" | "bottom";
|
|
2064
|
+
placement?: "top" | "top-start" | "bottom" | "bottom-start";
|
|
2065
2065
|
/**
|
|
2066
2066
|
* The select's help text. If you need to display HTML, use the `help-text` slot instead.
|
|
2067
2067
|
*/
|
|
@@ -2090,6 +2090,10 @@
|
|
|
2090
2090
|
* When set to true, the select will not show the dropdown.
|
|
2091
2091
|
*/
|
|
2092
2092
|
noDropdown?: boolean;
|
|
2093
|
+
/**
|
|
2094
|
+
* When set to true, the expand icon is not rendered, e.g. when the select is used as a search box.
|
|
2095
|
+
*/
|
|
2096
|
+
noExpandIcon?: boolean;
|
|
2093
2097
|
/**
|
|
2094
2098
|
* When set to true, the select will show a loading spinner.
|
|
2095
2099
|
*/
|
|
@@ -2098,6 +2102,18 @@
|
|
|
2098
2102
|
* Behavior when typing into the display input <br/> <br/>@type {('select' | 'filter' | 'none')} 'select': default shoelace behavior, selects the first option that starts with the typed string 'filter': filters out options that do not include the typed string 'none' : does not do anything, the user cannot type
|
|
2099
2103
|
*/
|
|
2100
2104
|
inputBehavior?: "none" | "select" | "filter";
|
|
2105
|
+
/**
|
|
2106
|
+
* When set to true, the default `filterCallback` ignores accents and diacritics, so typing `cai dat` matches `Cài đặt`. Has no effect when `filterCallback` is overridden.
|
|
2107
|
+
*/
|
|
2108
|
+
filterIgnoreAccents?: boolean;
|
|
2109
|
+
/**
|
|
2110
|
+
* When set to true and `input-behavior` is `filter`, every match of the typed query inside each visible `cx-option`'s plain-text label is wrapped in the option's `match` part (bold by default). Options whose label contains elements are shown without a highlight.
|
|
2111
|
+
*/
|
|
2112
|
+
highlightMatches?: boolean;
|
|
2113
|
+
/**
|
|
2114
|
+
* The minimum number of typed characters before the listbox can open. Below it, clicking, typing and the keyboard do not open the listbox, and an open listbox closes. Set to 0 to open without typing.
|
|
2115
|
+
*/
|
|
2116
|
+
minQueryLength?: number;
|
|
2101
2117
|
/**
|
|
2102
2118
|
*
|
|
2103
2119
|
*/
|
|
@@ -7496,6 +7512,10 @@
|
|
|
7496
7512
|
* Sets the side for the component.
|
|
7497
7513
|
*/
|
|
7498
7514
|
side?: "right" | "left";
|
|
7515
|
+
/**
|
|
7516
|
+
* Where the close trigger sits along the sidebar's inner edge: `start` (top), `center` or `end` (bottom). Move it away from `start` when the top of the content holds a full-width control the trigger would overlap.
|
|
7517
|
+
*/
|
|
7518
|
+
closeTriggerPlacement?: "center" | "start" | "end";
|
|
7499
7519
|
/**
|
|
7500
7520
|
* Is the sidebar open?
|
|
7501
7521
|
*/
|
package/library/utils.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { a as e, i as t, n, o as r, r as i, t as a } from "./chunks/event.C11S4obG.js";
|
|
2
2
|
import { t as o } from "./chunks/custom-element.BEMYNDK1.js";
|
|
3
|
-
import { r as s, t as c } from "./chunks/i18n.
|
|
3
|
+
import { r as s, t as c } from "./chunks/i18n.Bjg2ubA4.js";
|
|
4
4
|
import { n as l, r as u, t as d } from "./chunks/slot.CZUlACxT.js";
|
|
5
5
|
import { t as f } from "./chunks/watch.Ub5r8btz.js";
|
|
6
6
|
import { a as p, c as m, i as h, l as g, n as _, o as v, r as y, s as b, t as x, u as S } from "./chunks/browser.Ct4pHP9I.js";
|
|
7
7
|
import { t as C } from "./chunks/debounce.Ci-xdsHE.js";
|
|
8
|
-
import { C as w, S as T, _ as
|
|
9
|
-
import { a as
|
|
10
|
-
import { a as
|
|
11
|
-
import { i as
|
|
12
|
-
import { a as
|
|
13
|
-
import { a as
|
|
14
|
-
import { n as
|
|
15
|
-
import { t as
|
|
16
|
-
import { a as
|
|
17
|
-
import { t as
|
|
18
|
-
import { n as
|
|
19
|
-
import { n as
|
|
20
|
-
import { t as
|
|
21
|
-
import { n as
|
|
22
|
-
import { i as
|
|
23
|
-
import { t as
|
|
24
|
-
import { t as
|
|
25
|
-
import { S as
|
|
26
|
-
import { $ as
|
|
27
|
-
import { n as
|
|
28
|
-
import { a as
|
|
29
|
-
import { a as
|
|
30
|
-
import { t as
|
|
31
|
-
import { n as
|
|
32
|
-
import { n as
|
|
33
|
-
export {
|
|
8
|
+
import { C as w, E as T, S as E, T as D, _ as O, a as k, b as A, c as j, d as M, f as N, g as P, h as F, i as I, l as L, m as R, n as z, o as B, p as V, r as H, s as U, t as W, u as G, v as K, w as q, x as J, y as Y } from "./chunks/string.9yahdkB8.js";
|
|
9
|
+
import { a as X, c as Z, d as Q, f as $, h as ee, i as te, l as ne, m as re, n as ie, o as ae, p as oe, r as se, s as ce, t as le, u as ue } from "./chunks/dom.BLHsooDR.js";
|
|
10
|
+
import { a as de, i as fe, n as pe, o as me, r as he, t as ge } from "./chunks/form.D_eBa3AQ.js";
|
|
11
|
+
import { i as _e, n as ve, r as ye, t as be } from "./chunks/time.p1t0NCwj.js";
|
|
12
|
+
import { a as xe, c as Se, i as Ce, l as we, n as Te, o as Ee, r as De, s as Oe, t as ke } from "./chunks/number.CNp5LKkv.js";
|
|
13
|
+
import { a as Ae, c as je, i as Me, l as Ne, n as Pe, o as Fe, r as Ie, s as Le, t as Re } from "./chunks/image.C0s1gL4z.js";
|
|
14
|
+
import { n as ze, t as Be } from "./chunks/waveform.BFEuRt2_.js";
|
|
15
|
+
import { t as Ve } from "./chunks/default-value.opqQgoRT.js";
|
|
16
|
+
import { a as He, c as Ue, i as We, l as Ge, n as Ke, o as qe, r as Je, s as Ye, t as Xe } from "./chunks/gradient.rrDxmV60.js";
|
|
17
|
+
import { t as Ze } from "./chunks/drag.s0AcVpKh.js";
|
|
18
|
+
import { n as Qe, t as $e } from "./chunks/math.od1DVmRk.js";
|
|
19
|
+
import { n as et, t as tt } from "./chunks/active-elements.Tk45XSNQ.js";
|
|
20
|
+
import { t as nt } from "./chunks/focus-when-visible.DKscgyKo.js";
|
|
21
|
+
import { n as rt, t as it } from "./chunks/tabbable.BSwpOHdm.js";
|
|
22
|
+
import { i as at, n as ot, r as st, t as ct } from "./chunks/scroll.CEH_a4pm.js";
|
|
23
|
+
import { t as lt } from "./chunks/user-agent.D2bRhUeS.js";
|
|
24
|
+
import { t as ut } from "./chunks/parse.CDrJ-NY7.js";
|
|
25
|
+
import { S as dt, _ as ft, b as pt, d as mt, f as ht, g as gt, h as _t, m as vt, p as yt, t as bt, u as xt, v as St, x as Ct, y as wt } from "./chunks/date.BL4L64Hx.js";
|
|
26
|
+
import { $ as Tt, A as Et, B as Dt, F as Ot, G as kt, H as At, I as jt, J as Mt, K as Nt, L as Pt, M as Ft, N as It, O as Lt, P as Rt, Q as zt, R as Bt, U as Vt, V as Ht, W as Ut, X as Wt, Y as Gt, Z as Kt, _ as qt, a as Jt, at as Yt, b as Xt, c as Zt, ct as Qt, d as $t, dt as en, et as tn, f as nn, ft as rn, g as an, h as on, i as sn, it as cn, j as ln, k as un, l as dn, lt as fn, m as pn, mt as mn, n as hn, nt as gn, o as _n, ot as vn, p as yn, pt as bn, q as xn, r as Sn, rt as Cn, s as wn, st as Tn, t as En, tt as Dn, u as On, ut as kn, v as An, y as jn, z as Mn } from "./chunks/src.CgqvT9Zj.js";
|
|
27
|
+
import { n as Nn } from "./chunks/modal.eB-mqL-y.js";
|
|
28
|
+
import { a as Pn, c as Fn, d as In, f as Ln, i as Rn, l as zn, m as Bn, n as Vn, o as Hn, p as Un, r as Wn, s as Gn, t as Kn, u as qn } from "./chunks/url.BCc06dE7.js";
|
|
29
|
+
import { a as Jn, c as Yn, d as Xn, f as Zn, h as Qn, i as $n, l as er, m as tr, n as nr, o as rr, p as ir, r as ar, s as or, t as sr, u as cr } from "./chunks/color.CIOzHtLK.js";
|
|
30
|
+
import { t as lr } from "./chunks/converters.CFh-tT4P.js";
|
|
31
|
+
import { n as ur, r as dr, t as fr } from "./chunks/responsive.L9Csz2w2.js";
|
|
32
|
+
import { n as pr, t as mr } from "./chunks/template.Cyvih0XQ.js";
|
|
33
|
+
export { _n as AUTO_FALLBACK_FORMAT, wn as AUTO_FORMAT_EXTENSION, Zt as AUTO_ORIGINAL_FORMAT_MAX_BYTES, sr as CMYK_VALIDATION_REGEX, xt as CalendarGrid, nr as ColorType, zt as CortexPopupController, fr as DEFAULT_BREAKPOINTS, bt as DateRangePresets, Kt as DragScroll, ge as FormControlController, ar as HEX_ALPHA_VALIDATION_REGEX, $n as HEX_VALIDATION_REGEX, d as HasSlotController, jt as HistoryManager, Ot as KeyboardKey, c as LocalizeController, Xe as MIN_GRADIENT_STOPS, dn as ORIGINAL_FORMAT, En as PRECISION, Kn as RELATIVE_URL_REGEX, Jn as RGB_VALIDATION_REGEX, On as SRCSET_WIDTH_LADDER, Vn as URL_DOMAIN_VALIDATION_REGEX, Wn as URL_INTRANET_DOMAIN_VALIDATION_REGEX, Rn as URL_PROTOCOL_VALIDATION_REGEX, Pn as URL_VALIDATION_REGEX, tt as activeElements, mt as addMonths, Tt as adjustRelativeValues, n as animateTo, Hn as appendProtocol, Gn as appendQueryParam, $t as applyTransformationsToUrl, nn as applyWidthToAssetUrl, yn as buildAssetSrcset, pn as buildSizesFromDisplayWidth, on as buildTransformationString, Be as buildWaveformPath, Re as calculateAspectRatioFit, $e as clamp, Pe as cleanImageFileName, be as clearZeroDurationParts, rr as convertColor, ke as convertDataUnits, Te as convertDurationToMilliseconds, De as convertPixelsToAspectRatio, Ie as convertSrcToBlob, Ke as createStopId, Me as cropImage, le as cssValueToPx, o as customElement, pe as customErrorValidityState, C as debounce, Ve as defaultValue, fn as downloadAsset, Ze as drag, W as emptyToSpace, z as escapeXML, or as extractColor, H as extractExtension, hn as extractFrames, I as extractRootData, Ce as extractValueAndUnit, ze as extractWaveformPeaks, Gt as fetchCortexApi, x as findAncestorWithBuggyStyle, _ as findContainingBlock, y as findCuttingAncestor, Sn as findFrameByColAndRow, tn as findIndexByProp, k as findSearchMatches, nt as focusWhenVisible, B as foldSearchText, he as formCollections, xe as formatAspectRatioString, Yn as formatColorCodeSeparator, ve as formatDurationPartsManually, er as formatHexCode, ht as formatIsoToDisplay, yt as formatMonthYearLabel, Ee as formatNumberWithGrouping, U as formatSecondsToTime, j as formatTimeToSeconds, ye as formatWithIntlDurationFormat, Oe as gcd, ie as getActiveElement, Nn as getActiveModals, fe as getAssociatedForm, se as getAttributes, L as getAttributesString, ur as getBreakpointsFromCSS, Dt as getBrowserFontVariants, cr as getColorType, Ae as getContainedImageSize, te as getCortexPopupLayer, X as getCurrentZIndex, vt as getDateMask, et as getDeepestActiveElement, dr as getDeviceType, _e as getDurationPartsByUnitsFormat, ae as getElementFromHTMLString, ce as getElementFromTemplate, _t as getFirstDayOfWeek, Ht as getFontFamilyOptionValue, At as getFontFamilyVariants, Pt as getFormControls, mr as getHighlightedTitle, pr as getHighlightedTitleHtml, l as getInnerHTML, sn as getInterval, Xn as getLightDarkCssString, Fe as getNaturalWidthHeight, Z as getNeededPaddingForBoxShadow, h as getNextAncestor, at as getOffset, ne as getRelativeClickPercentage, G as getRootIDString, it as getTabbableBoundary, rt as getTabbableElements, u as getTextContent, gt as getTodayIsoDate, Vt as getTypefaceOptionValue, Dn as groupBy, an as hasTransformSegment, M as htmlToPlainText, gn as insertAtIndex, Jt as insertFrameToCache, Cn as insertMultipleAtIndex, Je as interpolateStopColor, p as isChrome, lt as isCortexAdobePlugin, ue as isDomElement, Q as isElementInHorizontalView, Fn as isExpiredAssetUrl, v as isFirefox, Ut as isFontFamilyAvailable, Bt as isFormInteracted, N as isGalleryItemCardType, We as isGradientString, b as isIOS, $ as isInElement, Wt as isModKey, m as isSafari, Le as isSaveSrcValid, zn as isValidDomainOrIntranetUrl, ft as isValidIsoDate, qn as isValidUrl, St as isoToDate, mn as isoWeekNumber, oe as loadScript, ct as lockBodyScrolling, Zn as luminanceTextColor, cn as moveMultipleToIndex, Yt as moveToIndex, vn as multiSelectTo, He as normalizeAngle, wt as normalizeToIsoDate, ln as omit, kn as openAssetOverview, en as openFolderOverview, rn as openLink, V as padPath, R as parseBooleanString, ir as parseBorder, pt as parseDisplayToIso, i as parseDuration, qt as parseFileSizeToBytes, qe as parseGradient, Ct as parseIsoDate, Ft as parseJsonString, tr as parseLightDark, It as parseListString, Qn as parseShadow, An as parseTransformations, Rt as pick, g as popoverSupported, t as prefersReducedMotion, Qe as quantizeLargestRemainder, kt as quoteFontFamily, In as readAssetTokenExpiry, un as readLocalStorageValue, re as readSearchConsistency, F as reducePathToDirectChild, s as registerTranslation, Tn as removeAtIndex, Qt as removeMultipleAtIndex, je as resizeImage, jn as resolveAutoFormat, Xt as resolveAutoMaxWidth, Ln as resolveSpaceUrl, Se as rotateBox, Ne as rotateImage, P as safeExtension, O as safeString, K as sanitizeHTML, we as sanitizeRotation, ot as scrollIntoView, Mn as serialize, Ye as serializeGradient, bn as shareAsset, e as shimKeyframesHeightAuto, ee as sortByTopPosition, Ue as sortStops, Nt as sortTypefaceVariants, ut as splitBoxValues, Y as splitCamelCaseFormatted, Ge as splitTopLevel, r as stopAnimations, S as supportHLS, xn as testFontAvailability, lr as timecodeConverter, A as toCamelCase, dt as toIsoDate, J as toKebabCase, E as toPascalCase, Un as toRelativeUrl, w as toTitleCase, Bn as toUrlPathKey, Lt as toast, q as truncateTextMiddle, D as unescapeXML, st as unlockBodyScrolling, Mt as unquoteFontFamily, T as upperFirst, de as validValidityState, me as valueMissingValidityState, a as waitForEvent, f as watch, Et as writeLocalStorageValue };
|
package/package.json
CHANGED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { c as e, d as t } from "./lit.CyJqR2kf.js";
|
|
2
|
-
import { a as n, i as r, n as i, r as a, t as o } from "./cortex-element.DTrNUtdr.js";
|
|
3
|
-
import { t as s } from "./query.B1yi7t71.js";
|
|
4
|
-
import { t as c } from "./component.styles.0xM1ZmBs.js";
|
|
5
|
-
import { t as l } from "./custom-element.BEMYNDK1.js";
|
|
6
|
-
import { t as u } from "./i18n.CQPiI18Q.js";
|
|
7
|
-
import { t as d } from "./watch.Ub5r8btz.js";
|
|
8
|
-
import { t as f } from "./class-map.D8nsNOVJ.js";
|
|
9
|
-
import { t as p } from "./when.BUskJLtZ.js";
|
|
10
|
-
import { t as m } from "./icon.CeQpEaQz.js";
|
|
11
|
-
import { t as h } from "./space.Dd8jezXK.js";
|
|
12
|
-
//#region ../../packages/types/src/option.ts
|
|
13
|
-
var g = /* @__PURE__ */ function(e) {
|
|
14
|
-
return e.Left = "left", e.Right = "right", e;
|
|
15
|
-
}({}), _ = t`:host{-webkit-user-select:none;user-select:none;display:block}:host(:focus){outline:none}.option{font:var(--cx-font-label-small);font-family:var(--option-font-family), var(--cx-font-sans);font-weight:var(--option-font-weight,var(--cx-font-weight-medium));letter-spacing:var(--cx-letter-spacing-normal);color:var(--option-color,var(--cx-color-neutral-700));padding:var(--cx-spacing-x-small) var(--cx-spacing-medium) var(--cx-spacing-x-small) var(--cx-spacing-x-small);transition:var(--cx-transition-fast) fill;cursor:pointer;align-items:center;display:flex;position:relative}.option:not(.option--show-check){padding-inline:var(--cx-spacing-small)}.option--hover:not(.option--current):not(.option--disabled){background-color:var(--cx-menu-item-background-color-hover)}.option--current,.option--current.option--disabled{background-color:var(--cx-menu-item-background-color-hover);opacity:1}.option--selected{color:var(--option-selected-color,var(--cx-color-primary));font-weight:var(--option-selected-font-weight,var(--cx-font-weight-regular))}.option--disabled{opacity:.5;cursor:default;outline:none}.option__content{flex:1}.option__label{line-height:var(--cx-line-height-medium);flex:auto;display:inline-block}.option .option__check{visibility:hidden;flex:none;justify-content:center;align-items:center;padding-inline-end:var(--cx-spacing-2x-small);display:none}.option--show-check .option__check{display:block}.option--show-check.option--selected .option__check{visibility:visible}.option__help-text{color:var(--option-help-text-color,var(--cx-color-neutral-600));font-weight:var(--option-help-text-font-weight,var(--cx-font-weight-regular))}.option--selected .option__content .option__help-text{color:var(--option-selected-help-text-color,var(--cx-color-primary));font-weight:var(--option-selected-help-text-font-weight,var(--cx-font-weight-regular))}.option__prefix,.option__suffix{flex:none;align-items:center;display:flex}.option__prefix::slotted(*){margin-inline-end:var(--cx-spacing-x-small)}.option__suffix::slotted(*){margin-inline-start:var(--cx-spacing-x-small)}.option__prefix{align-self:var(--prefix-alignment,center)}.option__suffix{align-self:var(--suffix-alignment,center)}.option__check{align-self:var(--check-alignment,center)}@media (forced-colors:active){:host(:hover:not([aria-disabled=true])) .option{outline-offset:-1px;outline:1px dashed selecteditem}}`, v = class extends o {
|
|
16
|
-
constructor(...e) {
|
|
17
|
-
super(...e), this.localize = new u(this), this.current = !1, this.selected = !1, this.hasHover = !1, this.value = "", this.disabled = !1, this.showCheck = !1, this.checkPlacement = g.Left;
|
|
18
|
-
}
|
|
19
|
-
static #e = this.styles = [c, _];
|
|
20
|
-
static #t = this.dependencies = {
|
|
21
|
-
"cx-icon": m,
|
|
22
|
-
"cx-space": h
|
|
23
|
-
};
|
|
24
|
-
runFirstUpdated() {
|
|
25
|
-
this.setAttribute("role", "option"), this.setAttribute("aria-selected", "false");
|
|
26
|
-
}
|
|
27
|
-
handleDefaultSlotChange() {
|
|
28
|
-
let e = this.getTextLabel();
|
|
29
|
-
if (this.cachedTextLabel === void 0) {
|
|
30
|
-
this.cachedTextLabel = e;
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
e !== this.cachedTextLabel && (this.cachedTextLabel = e, this.emit("slotchange", {
|
|
34
|
-
bubbles: !0,
|
|
35
|
-
cancelable: !1,
|
|
36
|
-
composed: !1
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
handleMouseEnter() {
|
|
40
|
-
this.hasHover = !0;
|
|
41
|
-
}
|
|
42
|
-
handleMouseLeave() {
|
|
43
|
-
this.hasHover = !1;
|
|
44
|
-
}
|
|
45
|
-
handleDisabledChange() {
|
|
46
|
-
this.setAttribute("aria-disabled", this.disabled ? "true" : "false");
|
|
47
|
-
}
|
|
48
|
-
handleSelectedChange() {
|
|
49
|
-
this.setAttribute("aria-selected", this.selected ? "true" : "false");
|
|
50
|
-
}
|
|
51
|
-
handleValueChange() {
|
|
52
|
-
typeof this.value != "string" && (this.value = String(this.value)), this.value.includes(" ") && (console.error("Option values cannot include a space. All spaces have been replaced with underscores.", this), this.value = this.value.replace(/ /g, "_"));
|
|
53
|
-
}
|
|
54
|
-
getTextLabel() {
|
|
55
|
-
let e = this.childNodes, t = "";
|
|
56
|
-
return [...e].forEach((e) => {
|
|
57
|
-
e.nodeType === Node.ELEMENT_NODE && (e.hasAttribute("slot") || (t += e.textContent)), e.nodeType === Node.TEXT_NODE && (t += e.textContent);
|
|
58
|
-
}), t.trim();
|
|
59
|
-
}
|
|
60
|
-
render() {
|
|
61
|
-
return e`<div part="base" class=${f({
|
|
62
|
-
option: !0,
|
|
63
|
-
"option--current": this.current,
|
|
64
|
-
"option--disabled": this.disabled,
|
|
65
|
-
"option--hover": this.hasHover,
|
|
66
|
-
"option--selected": this.selected,
|
|
67
|
-
"option--show-check": this.showCheck
|
|
68
|
-
})} @mouseenter=${this.handleMouseEnter} @mouseleave=${this.handleMouseLeave}>${p(this.checkPlacement === g.Left, () => e`<cx-icon part="checked-icon" class="option__check" name="check" library="system" aria-hidden="true"></cx-icon>`)}<slot part="prefix" name="prefix" class="option__prefix"></slot><cx-space part="content" class="option__content" direction="vertical" spacing="3x-small"><slot part="label" class="option__label" @slotchange=${this.handleDefaultSlotChange}></slot><slot part="help-text" name="help-text" class="option__help-text"></slot></cx-space><slot part="suffix" name="suffix" class="option__suffix"></slot>${p(this.checkPlacement === g.Right, () => e`<cx-icon part="checked-icon" class="option__check" name="check" library="system" aria-hidden="true"></cx-icon>`)}</div>`;
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
i([s(".option__label"), a("design:type", typeof HTMLSlotElement > "u" ? Object : HTMLSlotElement)], v.prototype, "defaultSlot", void 0), i([r(), a("design:type", Object)], v.prototype, "current", void 0), i([r(), a("design:type", Object)], v.prototype, "selected", void 0), i([r(), a("design:type", Object)], v.prototype, "hasHover", void 0), i([n({ reflect: !0 }), a("design:type", Object)], v.prototype, "value", void 0), i([n({
|
|
72
|
-
reflect: !0,
|
|
73
|
-
type: Boolean
|
|
74
|
-
}), a("design:type", Object)], v.prototype, "disabled", void 0), i([n({
|
|
75
|
-
attribute: "show-check",
|
|
76
|
-
reflect: !0,
|
|
77
|
-
type: Boolean
|
|
78
|
-
}), a("design:type", Object)], v.prototype, "showCheck", void 0), i([n({
|
|
79
|
-
attribute: "check-placement",
|
|
80
|
-
reflect: !0,
|
|
81
|
-
type: String
|
|
82
|
-
}), a("design:type", g === void 0 ? Object : g)], v.prototype, "checkPlacement", void 0), i([
|
|
83
|
-
d("disabled"),
|
|
84
|
-
a("design:type", Function),
|
|
85
|
-
a("design:paramtypes", []),
|
|
86
|
-
a("design:returntype", void 0)
|
|
87
|
-
], v.prototype, "handleDisabledChange", null), i([
|
|
88
|
-
d("selected"),
|
|
89
|
-
a("design:type", Function),
|
|
90
|
-
a("design:paramtypes", []),
|
|
91
|
-
a("design:returntype", void 0)
|
|
92
|
-
], v.prototype, "handleSelectedChange", null), i([
|
|
93
|
-
d("value"),
|
|
94
|
-
a("design:type", Function),
|
|
95
|
-
a("design:paramtypes", []),
|
|
96
|
-
a("design:returntype", void 0)
|
|
97
|
-
], v.prototype, "handleValueChange", null), v = i([l("cx-option")], v);
|
|
98
|
-
var y = v;
|
|
99
|
-
//#endregion
|
|
100
|
-
export { g as n, y as t };
|