@orangelogic/design-system 4.41.0 → 4.42.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/{block-width.BazivzBm.js → block-width.Di5s5CkQ.js} +18 -4
- package/library/chunks/{config-manager.DjEc937J.js → config-manager.h-KN_Efl.js} +1 -1
- package/library/components/types.js +2 -2
- package/library/package.json +1 -1
- package/library/packages/molecules/src/icon-picker/icon-picker.d.ts +13 -1
- package/package.json +1 -1
|
@@ -1076,6 +1076,9 @@ var lr = "data:application/json;base64,ewogICIxMjMiOiB7CiAgICAiY2F0ZWdvcmllcyI6I
|
|
|
1076
1076
|
async handleVariantChange() {
|
|
1077
1077
|
await this.updateComplete, this.runFirstUpdated();
|
|
1078
1078
|
}
|
|
1079
|
+
async handleSelectOptionsChange() {
|
|
1080
|
+
await this.updateComplete, await this.selectVirtualizer?.layoutComplete?.catch(() => void 0), this.select?.requestUpdate();
|
|
1081
|
+
}
|
|
1079
1082
|
async handleCustomIconValidation() {
|
|
1080
1083
|
await this.updateComplete, await this.select?.updateComplete, this.updateCustomIconValidity();
|
|
1081
1084
|
}
|
|
@@ -1137,6 +1140,12 @@ var lr = "data:application/json;base64,ewogICIxMjMiOiB7CiAgICAiY2F0ZWdvcmllcyI6I
|
|
|
1137
1140
|
handleSearchInput(e) {
|
|
1138
1141
|
this.searchTerm = e.target.value.toLowerCase();
|
|
1139
1142
|
}
|
|
1143
|
+
handleSelectSearchInput() {
|
|
1144
|
+
this.searchTerm = this.select.displayInput.value.trim().toLowerCase();
|
|
1145
|
+
}
|
|
1146
|
+
handleSelectSearchReset(e) {
|
|
1147
|
+
e.target === this.select && (this.searchTerm = "");
|
|
1148
|
+
}
|
|
1140
1149
|
handleMenuSelect(e) {
|
|
1141
1150
|
let t = e.detail.item.value;
|
|
1142
1151
|
this.value = this.setValueMenuSelect(this.value.name, t), this.emit("cx-change");
|
|
@@ -1163,8 +1172,8 @@ var lr = "data:application/json;base64,ewogICIxMjMiOiB7CiAgICAiY2F0ZWdvcmllcyI6I
|
|
|
1163
1172
|
selectGetOptionLabel(e) {
|
|
1164
1173
|
return !e || !(e instanceof E) ? this.value?.name.toString() : e.value === "custom" ? this.customOptionLabel || this.localize.term("custom") : e.dataset.name || e.value.toString();
|
|
1165
1174
|
}
|
|
1166
|
-
selectFilterCallback(e
|
|
1167
|
-
return
|
|
1175
|
+
selectFilterCallback(e) {
|
|
1176
|
+
return e instanceof E;
|
|
1168
1177
|
}
|
|
1169
1178
|
renderIcon(e, t) {
|
|
1170
1179
|
return e.startsWith("fa ") ? n`<cx-icon slot=${v(t)} variant="fa" name=${e}></cx-icon>` : n`<cx-icon slot=${v(t)} name=${e}></cx-icon>`;
|
|
@@ -1182,7 +1191,7 @@ var lr = "data:application/json;base64,ewogICIxMjMiOiB7CiAgICAiY2F0ZWdvcmllcyI6I
|
|
|
1182
1191
|
}
|
|
1183
1192
|
renderSelectMode() {
|
|
1184
1193
|
let e = this.value?.name.trim();
|
|
1185
|
-
return n`<cx-select part="base" class="icon-picker__select" value=${v(this.value?.name)} placeholder=${this.searchPlaceholder || this.localize.term("search")} no-option-text=${this.localize.term("noResults")} ?clearable=${this.clearable} .form=${this.requireCustomIcon ? this.closest("form") : void 0} hoist no-flip data-label=${this.localize.term("iconPicker")} @cx-change=${this.handleSelectValueChange} @cx-show=${this.handleSelectBeforeShow} @cx-after-show=${this.handleSelectShow} .setOptionCurrent=${this.setSelectOptionCurrent}>${this.renderSelectPrefixIcon(e)}
|
|
1194
|
+
return n`<cx-select part="base" class="icon-picker__select" value=${v(this.value?.name)} placeholder=${this.searchPlaceholder || this.localize.term("search")} no-option-text=${this.localize.term("noResults")} ?clearable=${this.clearable} .form=${this.requireCustomIcon ? this.closest("form") : void 0} hoist no-flip data-label=${this.localize.term("iconPicker")} @cx-change=${this.handleSelectValueChange} @input=${this.handleSelectSearchInput} @cx-blur=${this.handleSelectSearchReset} @cx-clear=${this.handleSelectSearchReset} @cx-show=${this.handleSelectBeforeShow} @cx-after-show=${this.handleSelectShow} .setOptionCurrent=${this.setSelectOptionCurrent}>${this.renderSelectPrefixIcon(e)}
|
|
1186
1195
|
${y(this.showVirtualizer, () => n`<lit-virtualizer .items=${this.virtualListItems} .renderItem=${this.renderOption}></lit-virtualizer>`)}
|
|
1187
1196
|
${y(!this.noCustomOption, () => n`<div part="footer" class="icon-picker__select__footer"><cx-divider part="footer-divider" class="icon-picker__select__footer__divider"></cx-divider><cx-option part="custom-button" class="icon-picker__select__footer__option" value="custom">${y(this.customOptionIcon, () => n`<cx-icon slot="prefix" name=${this.customOptionIcon}></cx-icon>`)}${this.customOptionLabel || this.localize.term("custom")}</cx-option></div>`)}</cx-select>${y(this.value?.name === "custom", () => this.renderCustomIconPicker())}
|
|
1188
1197
|
`;
|
|
@@ -1200,7 +1209,7 @@ var lr = "data:application/json;base64,ewogICIxMjMiOiB7CiAgICAiY2F0ZWdvcmllcyI6I
|
|
|
1200
1209
|
${y(this.canPickColor, () => n`<cx-bicolor-picker value=${at(this.color)} @cx-bicolor-picker-change=${this.handleBicolorChange}></cx-bicolor-picker>`)}</cx-space>`;
|
|
1201
1210
|
}
|
|
1202
1211
|
};
|
|
1203
|
-
l([f(".icon-picker__select"), u("design:type", O === void 0 ? Object : O)], U.prototype, "select", void 0), l([f(".icon-picker__select__footer__option"), u("design:type", E === void 0 ? Object : E)], U.prototype, "customOption", void 0), l([f("cx-dropdown"), u("design:type", w === void 0 ? Object : w)], U.prototype, "dropdown", void 0), l([s({
|
|
1212
|
+
l([f(".icon-picker__select"), u("design:type", O === void 0 ? Object : O)], U.prototype, "select", void 0), l([f(".icon-picker__select__footer__option"), u("design:type", E === void 0 ? Object : E)], U.prototype, "customOption", void 0), l([f("cx-dropdown"), u("design:type", w === void 0 ? Object : w)], U.prototype, "dropdown", void 0), l([f(".icon-picker__select lit-virtualizer"), u("design:type", Object)], U.prototype, "selectVirtualizer", void 0), l([s({
|
|
1204
1213
|
converter: { fromAttribute(e) {
|
|
1205
1214
|
if (!e) return {
|
|
1206
1215
|
name: "",
|
|
@@ -1271,6 +1280,11 @@ l([f(".icon-picker__select"), u("design:type", O === void 0 ? Object : O)], U.pr
|
|
|
1271
1280
|
u("design:paramtypes", []),
|
|
1272
1281
|
u("design:returntype", Promise)
|
|
1273
1282
|
], U.prototype, "handleVariantChange", null), l([
|
|
1283
|
+
g(["searchTerm", "showVirtualizer"], { waitUntilFirstUpdate: !0 }),
|
|
1284
|
+
u("design:type", Function),
|
|
1285
|
+
u("design:paramtypes", []),
|
|
1286
|
+
u("design:returntype", Promise)
|
|
1287
|
+
], U.prototype, "handleSelectOptionsChange", null), l([
|
|
1274
1288
|
g("value", { waitUntilFirstUpdate: !0 }),
|
|
1275
1289
|
g("requireCustomIcon", { waitUntilFirstUpdate: !0 }),
|
|
1276
1290
|
g("variant"),
|
|
@@ -14,7 +14,7 @@ import { t as b } from "./style-map.DPGQIxip.js";
|
|
|
14
14
|
import { t as x } from "./button.DnOMjl_G.js";
|
|
15
15
|
import { t as ee } from "./tooltip.DWx9VYtS.js";
|
|
16
16
|
import { t as te } from "./line-clamp.B7QEzpUF.js";
|
|
17
|
-
import { C as ne, D as re, E as ie, O as ae, S as oe, T as se, _ as ce, a as le, b as ue, c as de, g as fe, i as pe, l as me, n as he, o as ge, s as S, t as C, v as w, w as T, x as E, y as D } from "./block-width.
|
|
17
|
+
import { C as ne, D as re, E as ie, O as ae, S as oe, T as se, _ as ce, a as le, b as ue, c as de, g as fe, i as pe, l as me, n as he, o as ge, s as S, t as C, v as w, w as T, x as E, y as D } from "./block-width.Di5s5CkQ.js";
|
|
18
18
|
import { t as O } from "./typography.B0mkhqTB.js";
|
|
19
19
|
import { t as k } from "./button-group.CPfXrqyq.js";
|
|
20
20
|
import { t as A } from "./card.3c-X4hqR.js";
|
|
@@ -38,7 +38,7 @@ import { t as kt } from "../chunks/resize-observer.D9EHlnZI.js";
|
|
|
38
38
|
import { t as At } from "../chunks/line-clamp.B7QEzpUF.js";
|
|
39
39
|
import { t as jt } from "../chunks/tag.BySfbRok.js";
|
|
40
40
|
import { t as Mt } from "../chunks/array-line-clamp.BWWMLJhi.js";
|
|
41
|
-
import { A as Nt, C as Pt, D as Ft, E as It, O as Lt, S as Rt, T as zt, d as Bt, f as Vt, h as Ht, k as Ut, m as Wt, o as Gt, p as Kt, r as qt, s as Jt, t as Yt, u as Xt, w as Zt, x as Qt } from "../chunks/block-width.
|
|
41
|
+
import { A as Nt, C as Pt, D as Ft, E as It, O as Lt, S as Rt, T as zt, d as Bt, f as Vt, h as Ht, k as Ut, m as Wt, o as Gt, p as Kt, r as qt, s as Jt, t as Yt, u as Xt, w as Zt, x as Qt } from "../chunks/block-width.Di5s5CkQ.js";
|
|
42
42
|
import { n as $t, t as en } from "../chunks/position-picker.dY_vgF_H.js";
|
|
43
43
|
import { a as tn, i as nn, n as rn, o as an, r as on, s as sn, t as cn } from "../chunks/src.BJhIYoMP.js";
|
|
44
44
|
import { a as ln, c as un, i as dn, n as fn, o as pn, r as mn, t as hn, u as gn } from "../chunks/time.p1t0NCwj.js";
|
|
@@ -95099,7 +95099,7 @@ var j5 = class extends d {
|
|
|
95099
95099
|
return this.mappedSupportedLanguages.length > 1;
|
|
95100
95100
|
}
|
|
95101
95101
|
ensureConfigUi() {
|
|
95102
|
-
return this.configUiPromise ??= Promise.all([import("../chunks/config-manager.
|
|
95102
|
+
return this.configUiPromise ??= Promise.all([import("../chunks/config-manager.h-KN_Efl.js"), import("../chunks/configs-controller.Cm21QV6C.js").then((e) => e.n)]).then(async ([, e]) => {
|
|
95103
95103
|
this.configsController ??= new e.default(this.localize), await customElements.whenDefined("cx-config-manager"), await this.configManager?.updateComplete;
|
|
95104
95104
|
});
|
|
95105
95105
|
}
|
package/library/package.json
CHANGED
|
@@ -74,6 +74,7 @@ export default class CxIconPicker extends CortexElement {
|
|
|
74
74
|
private readonly select;
|
|
75
75
|
private readonly customOption;
|
|
76
76
|
private readonly dropdown?;
|
|
77
|
+
private readonly selectVirtualizer?;
|
|
77
78
|
value: {
|
|
78
79
|
name: string;
|
|
79
80
|
src: string;
|
|
@@ -155,6 +156,10 @@ export default class CxIconPicker extends CortexElement {
|
|
|
155
156
|
* @default undefined
|
|
156
157
|
*/
|
|
157
158
|
onRequestAsset: ((type: AssetTypeString, multiple?: boolean) => Promise<Asset | Record<string, Asset>>) | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Lower-cased text the icon list is filtered by. Set from the select's input in select mode
|
|
161
|
+
* and from the panel's search input in button mode.
|
|
162
|
+
*/
|
|
158
163
|
searchTerm: string;
|
|
159
164
|
/**
|
|
160
165
|
* Recreate the virtualizer for each open because it does not reliably
|
|
@@ -171,6 +176,8 @@ export default class CxIconPicker extends CortexElement {
|
|
|
171
176
|
/** Called by the containing form when reporting errors on save. */
|
|
172
177
|
reportValidity(): boolean;
|
|
173
178
|
handleVariantChange(): Promise<void>;
|
|
179
|
+
/** cx-select re-checks no-option-text only on its own render, not when the virtualizer swaps options. */
|
|
180
|
+
handleSelectOptionsChange(): Promise<void>;
|
|
174
181
|
handleCustomIconValidation(): Promise<void>;
|
|
175
182
|
private updateCustomIconValidity;
|
|
176
183
|
renderOption(item: IconData): import('lit-html').TemplateResult<1> | typeof nothing;
|
|
@@ -200,12 +207,17 @@ export default class CxIconPicker extends CortexElement {
|
|
|
200
207
|
handleContentBuilderAssetSelect(event: CxAssetPickerSelectEvent): Promise<void>;
|
|
201
208
|
handleContentBuilderAssetDelete(): Promise<void>;
|
|
202
209
|
private handleSearchInput;
|
|
210
|
+
/** Native input, not cx-input: cx-input also fires on an option pick, with its label in the input. */
|
|
211
|
+
private handleSelectSearchInput;
|
|
212
|
+
/** cx-select drops its typed filter on blur and on clear. */
|
|
213
|
+
private handleSelectSearchReset;
|
|
203
214
|
private handleMenuSelect;
|
|
204
215
|
private handleBicolorChange;
|
|
205
216
|
private setValueMenuSelect;
|
|
206
217
|
setSelectOptionCurrent(option: HTMLElement, current?: boolean): void;
|
|
207
218
|
selectGetOptionLabel(option: HTMLElement): string;
|
|
208
|
-
|
|
219
|
+
/** Filtering is done by virtualListItems; this runs per rendered option, so it can't track the search term. */
|
|
220
|
+
selectFilterCallback(option: HTMLElement): boolean;
|
|
209
221
|
private renderIcon;
|
|
210
222
|
private renderCustomIconPickerMenuItem;
|
|
211
223
|
private renderCustomIconPicker;
|