@oscarpalmer/oui 0.38.0 → 0.39.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/dist/css/badge.css +11 -8
- package/dist/css/button.css +106 -14
- package/dist/css/color-picker.css +555 -73
- package/dist/css/color.css +86 -86
- package/dist/css/combobox.css +98 -4
- package/dist/css/content.css +7 -6
- package/dist/css/floatable.css +1 -3
- package/dist/css/form.css +99 -6
- package/dist/css/icon.css +99 -0
- package/dist/css/listbox.css +3 -0
- package/dist/css/message.css +4 -3
- package/dist/css/mixins/button.mixins.css +1 -0
- package/dist/css/reset.css +1 -1
- package/dist/css/tabs.css +95 -3
- package/dist/css/typography.css +90 -0
- package/dist/js/color-picker/constants.color-picker.d.mts +2 -0
- package/dist/js/color-picker/constants.color-picker.mjs +59 -0
- package/dist/js/color-picker/dom.color-picker.d.mts +8 -0
- package/dist/js/color-picker/dom.color-picker.mjs +191 -0
- package/dist/js/color-picker/event.color-picker.d.mts +9 -0
- package/dist/js/color-picker/event.color-picker.mjs +2 -0
- package/dist/js/color-picker/form.color-picker.d.mts +5 -0
- package/dist/js/color-picker/form.color-picker.mjs +24 -0
- package/dist/js/color-picker/index.d.mts +2 -0
- package/dist/js/color-picker/index.mjs +303 -0
- package/dist/js/color-picker/misc.color-picker.d.mts +2 -0
- package/dist/js/color-picker/misc.color-picker.mjs +2 -0
- package/dist/js/color-picker/models.color-picker.d.mts +2 -0
- package/dist/js/color-picker/models.color-picker.mjs +24 -0
- package/dist/js/color-picker/output.color-picker.d.mts +8 -0
- package/dist/js/color-picker/output.color-picker.mjs +233 -0
- package/dist/js/color-picker/state.color-picker.d.mts +8 -0
- package/dist/js/color-picker/state.color-picker.mjs +2 -0
- package/dist/js/combobox/constants.combobox.d.mts +1 -1
- package/dist/js/combobox/dom.combobox.d.mts +12 -13
- package/dist/js/combobox/dom.combobox.mjs +5 -2
- package/dist/js/combobox/event.combobox.d.mts +20 -21
- package/dist/js/combobox/event.combobox.mjs +1 -1
- package/dist/js/combobox/index.d.mts +1 -1
- package/dist/js/combobox/index.mjs +2 -2
- package/dist/js/combobox/misc.combobox.d.mts +1 -1
- package/dist/js/combobox/misc.combobox.mjs +1 -1
- package/dist/js/combobox/models.combobox.d.mts +12 -13
- package/dist/js/combobox/state.combobox.d.mts +8 -9
- package/dist/js/combobox/state.combobox.mjs +1 -1
- package/dist/js/constants.color-picker-B-gFjL8m.d.mts +364 -0
- package/dist/js/constants.combobox-8EMRmv09.d.mts +18 -0
- package/dist/js/constants.listbox-DGnX32kv.d.mts +8 -0
- package/dist/js/dialog.d.mts +2 -2
- package/dist/js/dialog.mjs +1 -1
- package/dist/js/{draggable-a6w0J1OD.d.mts → draggable-B5-70SZm.d.mts} +5 -4
- package/dist/js/event.color-picker-BEpq0Adu.mjs +485 -0
- package/dist/js/floatable/floatable.embedded.d.mts +1 -1
- package/dist/js/floatable/floatable.embedded.mjs +2 -2
- package/dist/js/floatable/floatable.standalone.d.mts +1 -1
- package/dist/js/{floatable.embedded-Bct4U5Dm.d.mts → floatable.embedded-DQYkXt8X.d.mts} +1 -1
- package/dist/js/focus-trap/focus-trap.embedded.d.mts +1 -1
- package/dist/js/focus-trap/focus-trap.embedded.mjs +3 -3
- package/dist/js/focus-trap/focus-trap.standalone.d.mts +1 -1
- package/dist/js/{focus-trap.embedded-DR8NpZfr.d.mts → focus-trap.embedded-CjyFQYow.d.mts} +2 -2
- package/dist/js/{index-DJdFlTLm.d.mts → index-C5D3-oiI.d.mts} +2 -2
- package/dist/js/index.d.mts +7 -7
- package/dist/js/index.mjs +5 -3
- package/dist/js/internal/attributable.d.mts +2 -3
- package/dist/js/internal/draggable.d.mts +1 -1
- package/dist/js/internal/draggable.mjs +5 -5
- package/dist/js/internal/listbox/listbox.constants.d.mts +7 -10
- package/dist/js/internal/listbox/listbox.constants.mjs +15 -16
- package/dist/js/internal/listbox/listbox.data.d.mts +9 -10
- package/dist/js/internal/listbox/listbox.data.mjs +1 -1
- package/dist/js/internal/listbox/listbox.dom.d.mts +19 -20
- package/dist/js/internal/listbox/listbox.dom.mjs +1 -1
- package/dist/js/internal/listbox/listbox.event.d.mts +3 -4
- package/dist/js/internal/listbox/listbox.event.mjs +4 -4
- package/dist/js/internal/listbox/listbox.form.d.mts +4 -5
- package/dist/js/internal/listbox/listbox.misc.d.mts +10 -11
- package/dist/js/internal/listbox/listbox.misc.mjs +1 -1
- package/dist/js/internal/listbox/listbox.model.d.mts +1 -1
- package/dist/js/internal/listbox/listbox.state.d.mts +5 -6
- package/dist/js/internal/listbox/listbox.state.mjs +1 -1
- package/dist/js/internal/misc.d.mts +4 -4
- package/dist/js/internal/misc.mjs +9 -1
- package/dist/js/internal/navigable.d.mts +9 -10
- package/dist/js/internal/navigable.mjs +3 -3
- package/dist/js/listbox/constants.listbox.d.mts +1 -1
- package/dist/js/listbox/event.listbox.d.mts +6 -7
- package/dist/js/listbox/event.listbox.mjs +1 -1
- package/dist/js/listbox/index.d.mts +5 -5
- package/dist/js/listbox/index.mjs +2 -2
- package/dist/js/listbox/misc.listbox.d.mts +1 -1
- package/dist/js/listbox/misc.listbox.mjs +1 -1
- package/dist/js/listbox/state.listbox.d.mts +7 -8
- package/dist/js/listbox/state.listbox.mjs +1 -1
- package/dist/js/{listbox.data-C7CRa5Ya.mjs → listbox.data-DQ7-x2uY.mjs} +5 -5
- package/dist/js/{listbox.model-CRReGOmu.d.mts → listbox.model-BHPA7GM4.d.mts} +3 -3
- package/dist/js/menu.mjs +2 -2
- package/dist/js/{misc.listbox-Cyz2CRDy.mjs → misc.listbox-DKB-j0UK.mjs} +4 -4
- package/dist/js/{misc.listbox-gnoJhrTr.d.mts → misc.listbox-mZMuYOxg.d.mts} +1 -1
- package/dist/js/movable/movable.embedded.d.mts +1 -1
- package/dist/js/movable/movable.embedded.mjs +2 -2
- package/dist/js/movable/movable.standalone.d.mts +1 -1
- package/dist/js/popover.d.mts +2 -2
- package/dist/js/popover.mjs +1 -1
- package/dist/js/resizable/resizable.embedded.d.mts +1 -1
- package/dist/js/resizable/resizable.embedded.mjs +5 -5
- package/dist/js/resizable/resizable.standalone.d.mts +1 -1
- package/dist/js/{resizable.embedded-3qoR0Bjm.d.mts → resizable.embedded-dvhdfQgt.d.mts} +1 -1
- package/dist/js/sortable/sortable.embedded.d.mts +1 -1
- package/dist/js/sortable/sortable.embedded.mjs +4 -4
- package/dist/js/sortable/sortable.standalone.d.mts +1 -1
- package/dist/js/splitter.d.mts +2 -3
- package/dist/js/splitter.mjs +7 -7
- package/dist/js/{state.combobox-Qm3FWzYW.mjs → state.combobox-BWDFHwoi.mjs} +11 -11
- package/dist/js/tabs.d.mts +4 -5
- package/dist/js/tooltip.d.mts +1 -1
- package/dist/js/tooltip.mjs +3 -3
- package/package.json +24 -24
- package/dist/js/color-picker.d.mts +0 -213
- package/dist/js/color-picker.mjs +0 -924
- package/dist/js/constants.combobox-DmRAMC64.d.mts +0 -26
- package/dist/js/constants.listbox-DRsXUxd3.d.mts +0 -14
- package/src/css/a11y.scss +0 -13
- package/src/css/badge.scss +0 -62
- package/src/css/button.scss +0 -50
- package/src/css/color-picker.scss +0 -344
- package/src/css/color.scss +0 -113
- package/src/css/combobox.scss +0 -255
- package/src/css/content.scss +0 -181
- package/src/css/flex.scss +0 -107
- package/src/css/floatable.scss +0 -155
- package/src/css/form.scss +0 -575
- package/src/css/listbox.scss +0 -121
- package/src/css/message.scss +0 -74
- package/src/css/mixins/badge.mixins.scss +0 -53
- package/src/css/mixins/button.mixins.scss +0 -112
- package/src/css/mixins/input.mixins.scss +0 -114
- package/src/css/mixins/message.mixins.scss +0 -41
- package/src/css/mixins/misc.mixins.scss +0 -48
- package/src/css/mixins/shadow.mixins.scss +0 -57
- package/src/css/reset.scss +0 -392
- package/src/css/splitter.scss +0 -89
- package/src/css/table.scss +0 -107
- package/src/css/tabs.scss +0 -74
- package/src/js/color-picker.ts +0 -1653
- package/src/js/combobox/constants.combobox.ts +0 -83
- package/src/js/combobox/dom.combobox.ts +0 -411
- package/src/js/combobox/event.combobox.ts +0 -365
- package/src/js/combobox/index.ts +0 -382
- package/src/js/combobox/misc.combobox.ts +0 -104
- package/src/js/combobox/models.combobox.ts +0 -54
- package/src/js/combobox/state.combobox.ts +0 -246
- package/src/js/dialog.ts +0 -255
- package/src/js/floatable/floatable.embedded.ts +0 -336
- package/src/js/floatable/floatable.standalone.ts +0 -6
- package/src/js/focus-trap/focus-trap.embedded.ts +0 -411
- package/src/js/focus-trap/focus-trap.standalone.ts +0 -1
- package/src/js/index.ts +0 -16
- package/src/js/internal/attributable.ts +0 -73
- package/src/js/internal/draggable.ts +0 -657
- package/src/js/internal/listbox/listbox.constants.ts +0 -25
- package/src/js/internal/listbox/listbox.data.ts +0 -287
- package/src/js/internal/listbox/listbox.dom.ts +0 -446
- package/src/js/internal/listbox/listbox.event.ts +0 -129
- package/src/js/internal/listbox/listbox.form.ts +0 -125
- package/src/js/internal/listbox/listbox.misc.ts +0 -135
- package/src/js/internal/listbox/listbox.model.ts +0 -169
- package/src/js/internal/listbox/listbox.state.ts +0 -82
- package/src/js/internal/misc.ts +0 -27
- package/src/js/internal/navigable.ts +0 -317
- package/src/js/l10n.ts +0 -192
- package/src/js/listbox/constants.listbox.ts +0 -61
- package/src/js/listbox/event.listbox.ts +0 -106
- package/src/js/listbox/index.ts +0 -364
- package/src/js/listbox/misc.listbox.ts +0 -70
- package/src/js/listbox/state.listbox.ts +0 -194
- package/src/js/menu.ts +0 -348
- package/src/js/movable/movable.embedded.ts +0 -318
- package/src/js/movable/movable.standalone.ts +0 -2
- package/src/js/popover.ts +0 -229
- package/src/js/resizable/resizable.embedded.ts +0 -413
- package/src/js/resizable/resizable.standalone.ts +0 -5
- package/src/js/sortable/sortable.embedded.ts +0 -527
- package/src/js/sortable/sortable.standalone.ts +0 -2
- package/src/js/splitter.ts +0 -583
- package/src/js/tabs.ts +0 -441
- package/src/js/toolbar.ts +0 -63
- package/src/js/tooltip.ts +0 -367
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
import { createEmbeddedFloatable } from "./floatable/floatable.embedded.mjs";
|
|
2
|
+
import { getLocalization, localize, updateLocalizations } from "./l10n.mjs";
|
|
3
|
+
import { COLOR_PICKER_ATTRIBUTE_COPY_ERROR, COLOR_PICKER_ATTRIBUTE_COPY_SUCCESS, COLOR_PICKER_EXPRESSION_HEX_PREFIX, COLOR_PICKER_INPUT_TYPES, COLOR_PICKER_KEYS, COLOR_PICKER_MESSAGE_INPUT, COLOR_PICKER_MESSAGE_LABEL, COLOR_PICKER_OUTPUTS, COLOR_PICKER_SELECTOR_COPY, COLOR_PICKER_SELECTOR_INPUT, COLOR_PICKER_SELECTOR_OUTPUT_INPUT, COLOR_PICKER_SELECTOR_WELL, COLOR_PICKER_SELECTOR_WELL_KNOB, COLOR_PICKER_TAGNAME, colorPickerLocalizations } from "./color-picker/constants.color-picker.mjs";
|
|
4
|
+
import { copyValue } from "./internal/misc.mjs";
|
|
5
|
+
import { OuiColorPickerEvent } from "./color-picker/models.color-picker.mjs";
|
|
6
|
+
import { updateColorPickerForm, updateColorPickerValidity } from "./color-picker/form.color-picker.mjs";
|
|
7
|
+
import { getColorPickerOutputFormat, updateColorPickerOutputCopyLabel, updateColorPickerOutputInputs, updateColorPickerOutputLabels } from "./color-picker/output.color-picker.mjs";
|
|
8
|
+
import { createColorPickerAnchor, createColorPickerContent } from "./color-picker/dom.color-picker.mjs";
|
|
9
|
+
import { getAria, setAria } from "@oscarpalmer/toretto/aria";
|
|
10
|
+
import { dispatch, getEventPosition, on } from "@oscarpalmer/toretto/event";
|
|
11
|
+
import { setAttribute, setAttributes } from "@oscarpalmer/toretto/attribute";
|
|
12
|
+
import { toggleStyles } from "@oscarpalmer/toretto/style";
|
|
13
|
+
import { findAncestor } from "@oscarpalmer/toretto/find";
|
|
14
|
+
import { supportsTouch } from "@oscarpalmer/toretto/touch";
|
|
15
|
+
import { getColor, getForegroundColor, isHexColor, isHslColor, isHslaColor, isHwbColor, isHwbaColor, isRgbColor, isRgbaColor } from "@oscarpalmer/atoms/color";
|
|
16
|
+
import { clamp } from "@oscarpalmer/atoms";
|
|
17
|
+
import { getAttribute as getAttribute$1, setAria as setAria$1, setProperty } from "@oscarpalmer/toretto";
|
|
18
|
+
import { createElement as createElement$1 } from "@oscarpalmer/toretto/create";
|
|
19
|
+
//#region src/js/color-picker/state.color-picker.ts
|
|
20
|
+
function attachColorPicker(state) {
|
|
21
|
+
const { anchor, content, host, id, inline, input, label, listeners, style } = state;
|
|
22
|
+
if (!inline) {
|
|
23
|
+
state.floatable = createEmbeddedFloatable(anchor.container ?? anchor.container, content.element, {
|
|
24
|
+
position: "below-start",
|
|
25
|
+
reusable: false
|
|
26
|
+
});
|
|
27
|
+
state.floatable.update();
|
|
28
|
+
}
|
|
29
|
+
const labelId = `${id}_label`;
|
|
30
|
+
setAria(host, {
|
|
31
|
+
describedby: getAria(input, "describedby"),
|
|
32
|
+
labelledby: labelId
|
|
33
|
+
});
|
|
34
|
+
setAttributes(host, { name: input.name === "" ? input.id : input.name });
|
|
35
|
+
label.element.htmlFor = anchor.input.id;
|
|
36
|
+
label.element.id = labelId;
|
|
37
|
+
if (anchor.toggle != null) setAria(anchor.toggle, "expanded", false);
|
|
38
|
+
input.before(style, anchor.container, content.element);
|
|
39
|
+
input.remove();
|
|
40
|
+
listeners.push(on(host, "focusout", () => {
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
if (colorPickerMovement.parameters == null && !host.contains(document.activeElement)) state.floatable?.hide();
|
|
43
|
+
});
|
|
44
|
+
}), on(anchor.input, "change", () => {
|
|
45
|
+
onColorPickerInput(state);
|
|
46
|
+
}), on(anchor.input, "input", () => {
|
|
47
|
+
onColorPickerInput(state);
|
|
48
|
+
}), on(content.element, "beforetoggle", (event) => {
|
|
49
|
+
if (state.disabled) event.preventDefault();
|
|
50
|
+
}, { passive: false }), on(content.element, "toggle", (event) => {
|
|
51
|
+
const open = event.newState === "open";
|
|
52
|
+
if (anchor.toggle != null) setAria(anchor.toggle, "expanded", open);
|
|
53
|
+
if (open) content.well.knob.focus();
|
|
54
|
+
}), on(content.hue.input, "input", () => {
|
|
55
|
+
onColorPickerHue(state);
|
|
56
|
+
}));
|
|
57
|
+
if (content.opacity != null) listeners.push(on(content.opacity.input, "input", () => {
|
|
58
|
+
onColorPickerOpacity(state);
|
|
59
|
+
}));
|
|
60
|
+
if (content.output?.toggle != null) listeners.push(on(content.element, "change", (event) => {
|
|
61
|
+
onColorPickerOutputValue(event, state);
|
|
62
|
+
}), on(content.element, "input", (event) => {
|
|
63
|
+
onColorPickerOutputValue(event, state);
|
|
64
|
+
}), on(content.output.toggle, "change", () => {
|
|
65
|
+
onColorPickerOutputFormat(state);
|
|
66
|
+
}));
|
|
67
|
+
colorPickerMap.set(host, state);
|
|
68
|
+
colorPickerSet.add(state);
|
|
69
|
+
}
|
|
70
|
+
function detachColorPicker(state) {
|
|
71
|
+
const { anchor, content, floatable, host, input, label, style } = state;
|
|
72
|
+
floatable?.destroy();
|
|
73
|
+
setAria(host, {
|
|
74
|
+
describedby: void 0,
|
|
75
|
+
labelledby: void 0
|
|
76
|
+
});
|
|
77
|
+
setAttributes(host, { name: void 0 });
|
|
78
|
+
label.element.htmlFor = input.id;
|
|
79
|
+
label.element.id = label.id;
|
|
80
|
+
anchor.container.before(input);
|
|
81
|
+
anchor.container.remove();
|
|
82
|
+
content.element.remove();
|
|
83
|
+
style.remove();
|
|
84
|
+
const listeners = state.listeners.splice(0);
|
|
85
|
+
const { length } = listeners;
|
|
86
|
+
for (let index = 0; index < length; index += 1) listeners[index]();
|
|
87
|
+
colorPickerMap.delete(state.host);
|
|
88
|
+
colorPickerSet.delete(state);
|
|
89
|
+
}
|
|
90
|
+
function initializeColorPicker(element, internals) {
|
|
91
|
+
const input = element.querySelector("input");
|
|
92
|
+
if (input == null || !COLOR_PICKER_INPUT_TYPES.has(input.type)) throw new Error(COLOR_PICKER_MESSAGE_INPUT);
|
|
93
|
+
const label = element.querySelector(`label[for="${input.id}"]`);
|
|
94
|
+
if (label == null) throw new Error(COLOR_PICKER_MESSAGE_LABEL);
|
|
95
|
+
element.id = input.id;
|
|
96
|
+
const id = getColorPickerId();
|
|
97
|
+
const labelId = label.id;
|
|
98
|
+
const alpha = element.hasAttribute("alpha");
|
|
99
|
+
const color = getColor(input.value);
|
|
100
|
+
const copy = element.hasAttribute("copy");
|
|
101
|
+
const disabled = element.hasAttribute("disabled") || input.disabled;
|
|
102
|
+
const inline = element.hasAttribute("inline");
|
|
103
|
+
const output = getColorPickerOutput(element);
|
|
104
|
+
const readonly = element.hasAttribute("readonly") || input.readOnly;
|
|
105
|
+
const required = element.hasAttribute("required") || input.required;
|
|
106
|
+
const parameters = {
|
|
107
|
+
alpha,
|
|
108
|
+
color,
|
|
109
|
+
copy,
|
|
110
|
+
id,
|
|
111
|
+
inline,
|
|
112
|
+
input,
|
|
113
|
+
output
|
|
114
|
+
};
|
|
115
|
+
const anchor = createColorPickerAnchor(parameters);
|
|
116
|
+
const content = createColorPickerContent(parameters);
|
|
117
|
+
const formatted = color.toHexString(alpha);
|
|
118
|
+
const state = {
|
|
119
|
+
alpha,
|
|
120
|
+
anchor,
|
|
121
|
+
content,
|
|
122
|
+
copy,
|
|
123
|
+
disabled,
|
|
124
|
+
id,
|
|
125
|
+
inline,
|
|
126
|
+
input,
|
|
127
|
+
internals,
|
|
128
|
+
output,
|
|
129
|
+
readonly,
|
|
130
|
+
required,
|
|
131
|
+
color: {
|
|
132
|
+
foreground: "",
|
|
133
|
+
value: color
|
|
134
|
+
},
|
|
135
|
+
host: element,
|
|
136
|
+
label: {
|
|
137
|
+
element: label,
|
|
138
|
+
id: labelId
|
|
139
|
+
},
|
|
140
|
+
listeners: [],
|
|
141
|
+
localizations: {
|
|
142
|
+
component: {},
|
|
143
|
+
global: colorPickerLocalizations
|
|
144
|
+
},
|
|
145
|
+
style: createElement$1("style"),
|
|
146
|
+
value: {
|
|
147
|
+
current: formatted,
|
|
148
|
+
initial: formatted
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
attachColorPicker(state);
|
|
152
|
+
setAttributes(element, {
|
|
153
|
+
output,
|
|
154
|
+
alpha: alpha ? "" : void 0,
|
|
155
|
+
copy: copy ? "" : void 0,
|
|
156
|
+
inline: inline ? "" : void 0
|
|
157
|
+
});
|
|
158
|
+
setColorPickerDisabled(state, "disabled", disabled);
|
|
159
|
+
setColorPickerDisabled(state, "readonly", readonly);
|
|
160
|
+
setColorPickerRequired(state, required);
|
|
161
|
+
setColorPickerValues(state, false);
|
|
162
|
+
updateColorPickerLabels(state);
|
|
163
|
+
updateColorPickerValidity(state, isHexColor(state.value.current, alpha));
|
|
164
|
+
return state;
|
|
165
|
+
}
|
|
166
|
+
const colorPickerMap = /* @__PURE__ */ new WeakMap();
|
|
167
|
+
const colorPickerSet = /* @__PURE__ */ new Set();
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/js/color-picker/misc.color-picker.ts
|
|
170
|
+
function getColorPickerId() {
|
|
171
|
+
index += 1;
|
|
172
|
+
return `oui_color_picker_${index}`;
|
|
173
|
+
}
|
|
174
|
+
function getColorPickerOutput(element) {
|
|
175
|
+
const attribute = getAttribute$1(element, "output");
|
|
176
|
+
return COLOR_PICKER_OUTPUTS.has(attribute) ? attribute : "none";
|
|
177
|
+
}
|
|
178
|
+
function getColorPickerValueType(state, value) {
|
|
179
|
+
switch (true) {
|
|
180
|
+
case isHexColor(value, state.alpha): return state.alpha ? "hexa" : "hex";
|
|
181
|
+
case isHslColor(value): return "hsl";
|
|
182
|
+
case isHslaColor(value): return "hsla";
|
|
183
|
+
case isHwbColor(value): return "hwb";
|
|
184
|
+
case isHwbaColor(value): return "hwba";
|
|
185
|
+
case isRgbColor(value): return "rgb";
|
|
186
|
+
case isRgbaColor(value): return "rgba";
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function setColorPickerLocalizations(first, second) {
|
|
190
|
+
updateColorPickerLocalizations(colorPickerLocalizations, colorPickerLocalizations.values, first, second);
|
|
191
|
+
}
|
|
192
|
+
function setColorPickerDisabled(state, type, value) {
|
|
193
|
+
state[type] = value;
|
|
194
|
+
setAria$1(state.host, type, value);
|
|
195
|
+
state.anchor.input.readOnly = value;
|
|
196
|
+
setAria$1(state.anchor.input, type, value);
|
|
197
|
+
setProperty(state.content.hue.input, "disabled", state.disabled || state.readonly);
|
|
198
|
+
if (state.anchor.toggle != null) setAria$1(state.anchor.toggle, "disabled", state.disabled);
|
|
199
|
+
if (state.content.opacity != null) setProperty(state.content.opacity.input, "disabled", state.disabled || state.readonly);
|
|
200
|
+
}
|
|
201
|
+
function setColorPickerRequired(state, value) {
|
|
202
|
+
state.required = value;
|
|
203
|
+
setAria$1(state.host, "required", value);
|
|
204
|
+
setAria$1(state.anchor.input, "required", value);
|
|
205
|
+
updateColorPickerValidity(state, isHexColor(state.value.current, state.alpha));
|
|
206
|
+
}
|
|
207
|
+
function setColorPickerValue(state, value, type) {
|
|
208
|
+
if (state == null) return;
|
|
209
|
+
const actual = type ?? getColorPickerValueType(state, value);
|
|
210
|
+
if (actual == null || type != null && type !== actual) return;
|
|
211
|
+
state.color.value[actual] = value;
|
|
212
|
+
setColorPickerValues(state, true);
|
|
213
|
+
}
|
|
214
|
+
function setColorPickerValues(state, focus, input) {
|
|
215
|
+
const { anchor, color, content, host, style } = state;
|
|
216
|
+
color.foreground = getForegroundColor(color.value).hex;
|
|
217
|
+
const { alpha, hex, hsl, rgb } = color.value;
|
|
218
|
+
const { hue, lightness, saturation } = hsl;
|
|
219
|
+
const { blue, green, red } = rgb;
|
|
220
|
+
const value = input ?? color.value.toHexString(state.alpha);
|
|
221
|
+
anchor.input.value = value;
|
|
222
|
+
content.hue.input.valueAsNumber = hue;
|
|
223
|
+
if (content.opacity != null) content.opacity.input.valueAsNumber = alpha;
|
|
224
|
+
state.value.current = value;
|
|
225
|
+
style.textContent = `#${host.id} {
|
|
226
|
+
--oui-color-picker-alpha: ${alpha};
|
|
227
|
+
--oui-color-picker-blue: ${blue};
|
|
228
|
+
--oui-color-picker-green: ${green};
|
|
229
|
+
--oui-color-picker-foreground: #${color.foreground};
|
|
230
|
+
--oui-color-picker-hex: #${hex};
|
|
231
|
+
--oui-color-picker-hue: ${hue};
|
|
232
|
+
--oui-color-picker-lightness: ${lightness};
|
|
233
|
+
--oui-color-picker-red: ${red};
|
|
234
|
+
--oui-color-picker-saturation: ${saturation};
|
|
235
|
+
}`;
|
|
236
|
+
updateColorPickerForm(state, isHexColor(state.value.current, state.alpha));
|
|
237
|
+
updateColorPickerOutputInputs(state);
|
|
238
|
+
updateColorPickerWell(state);
|
|
239
|
+
if (focus) content.well.knob.focus();
|
|
240
|
+
}
|
|
241
|
+
function updateColorPickerLabels(state) {
|
|
242
|
+
const { anchor, content, host, localizations } = state;
|
|
243
|
+
const { component, global } = localizations;
|
|
244
|
+
if (anchor.toggle != null) setAria$1(anchor.toggle, "label", localize(getLocalization(global, host, "toggle", component), {}, []));
|
|
245
|
+
content.hue.label.textContent = localize(getLocalization(global, host, "hue", component), {}, []);
|
|
246
|
+
content.well.label.textContent = localize(getLocalization(global, host, "wellLabel", component), {}, []);
|
|
247
|
+
updateColorPickerOutputLabels(state);
|
|
248
|
+
updateColorPickerWell(state);
|
|
249
|
+
if (content.opacity != null) content.opacity.label.textContent = localize(getLocalization(global, host, "opacity", component), {}, []);
|
|
250
|
+
}
|
|
251
|
+
function updateColorPickerLocalizations(instance, destination, first, second) {
|
|
252
|
+
updateLocalizations(instance, typeof first === "string" ? { [first]: second } : first, destination, () => {
|
|
253
|
+
for (const state of colorPickerSet) updateColorPickerLabels(state);
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
function updateColorPickerWell(state) {
|
|
257
|
+
const { color, content, host, localizations } = state;
|
|
258
|
+
const { component, global } = localizations;
|
|
259
|
+
const { lightness, saturation } = color.value.hsl;
|
|
260
|
+
setAria$1(content.well.knob, "valuetext", localize(getLocalization(global, host, "wellValue", component), {
|
|
261
|
+
lightness,
|
|
262
|
+
saturation
|
|
263
|
+
}, [lightness, saturation]));
|
|
264
|
+
}
|
|
265
|
+
let index = 0;
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region src/js/color-picker/event.color-picker.ts
|
|
268
|
+
function cancelMove(parameters) {
|
|
269
|
+
parameters.state.color.value.hexa = parameters.value;
|
|
270
|
+
setColorPickerValues(parameters.state, true);
|
|
271
|
+
colorPickerMovement.parameters = void 0;
|
|
272
|
+
styleToggler.remove();
|
|
273
|
+
}
|
|
274
|
+
function onClick(event) {
|
|
275
|
+
const button = findAncestor(event, COLOR_PICKER_SELECTOR_COPY);
|
|
276
|
+
if (!(button instanceof HTMLButtonElement)) return;
|
|
277
|
+
setAttributes(button, {
|
|
278
|
+
[COLOR_PICKER_ATTRIBUTE_COPY_ERROR]: void 0,
|
|
279
|
+
[COLOR_PICKER_ATTRIBUTE_COPY_SUCCESS]: void 0
|
|
280
|
+
});
|
|
281
|
+
const state = colorPickerMap.get(findAncestor(event, COLOR_PICKER_TAGNAME));
|
|
282
|
+
if (state == null || state.disabled) return;
|
|
283
|
+
const copy = button.dataset.color == null ? state.content.output?.copy : state.anchor.copy;
|
|
284
|
+
if (copy == null) return;
|
|
285
|
+
if (copy.timer != null) {
|
|
286
|
+
clearTimeout(copy.timer);
|
|
287
|
+
copy.timer = void 0;
|
|
288
|
+
}
|
|
289
|
+
const color = button.dataset.color ?? getColorPickerOutputFormat(state);
|
|
290
|
+
if (color == null) return;
|
|
291
|
+
let value;
|
|
292
|
+
switch (color) {
|
|
293
|
+
case "hex":
|
|
294
|
+
value = state.color.value.toHexString(state.alpha);
|
|
295
|
+
break;
|
|
296
|
+
case "hsl":
|
|
297
|
+
value = state.color.value.toHslString(state.alpha);
|
|
298
|
+
break;
|
|
299
|
+
case "hwb":
|
|
300
|
+
value = state.color.value.toHwbString(state.alpha);
|
|
301
|
+
break;
|
|
302
|
+
case "rgb": value = state.color.value.toRgbString(state.alpha);
|
|
303
|
+
}
|
|
304
|
+
if (value != null) copyValue(value, () => {
|
|
305
|
+
console.log("Copied value to clipboard:", value);
|
|
306
|
+
updateColorPickerCopy(copy, COLOR_PICKER_ATTRIBUTE_COPY_SUCCESS);
|
|
307
|
+
}, () => {
|
|
308
|
+
console.warn("Failed to copy value to clipboard:", value);
|
|
309
|
+
updateColorPickerCopy(copy, COLOR_PICKER_ATTRIBUTE_COPY_ERROR);
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
function onColorPickerHue(state) {
|
|
313
|
+
const hue = state.content.hue.input.valueAsNumber;
|
|
314
|
+
state.color.value.hsla = {
|
|
315
|
+
...state.color.value.hsla,
|
|
316
|
+
hue
|
|
317
|
+
};
|
|
318
|
+
setColorPickerValues(state, false);
|
|
319
|
+
}
|
|
320
|
+
function onColorPickerInput(state) {
|
|
321
|
+
const { alpha, anchor, color, host } = state;
|
|
322
|
+
const value = anchor.input.value.replace(COLOR_PICKER_EXPRESSION_HEX_PREFIX, "");
|
|
323
|
+
if (value.toLowerCase() === (alpha ? color.value.hexa : color.value.hex).toLowerCase()) return;
|
|
324
|
+
state.value.current = anchor.input.value;
|
|
325
|
+
const { length } = value;
|
|
326
|
+
let valid;
|
|
327
|
+
if (alpha) valid = isHexColor(value, true) && (length === 4 || length === 8);
|
|
328
|
+
else valid = isHexColor(value) && (length === 3 || length === 6);
|
|
329
|
+
if (valid) {
|
|
330
|
+
if (length === 3 || length === 6) color.value.hex = value;
|
|
331
|
+
else color.value.hexa = value;
|
|
332
|
+
}
|
|
333
|
+
setColorPickerValues(state, false, anchor.input.value);
|
|
334
|
+
dispatch(host, new OuiColorPickerEvent("oui:input", color.value, valid));
|
|
335
|
+
}
|
|
336
|
+
function onColorPickerOpacity(state) {
|
|
337
|
+
const opacity = state.content.opacity?.input.valueAsNumber;
|
|
338
|
+
if (opacity == null) return;
|
|
339
|
+
state.color.value.alpha = opacity;
|
|
340
|
+
setColorPickerValues(state, false);
|
|
341
|
+
}
|
|
342
|
+
function onColorPickerOutputFormat(state) {
|
|
343
|
+
const { items, toggle } = state.content.output ?? {};
|
|
344
|
+
if (items == null || toggle == null) return;
|
|
345
|
+
const attribute = `${COLOR_PICKER_TAGNAME}-output-${toggle.value}`;
|
|
346
|
+
for (const item of items) item.hidden = !item.hasAttribute(attribute);
|
|
347
|
+
if (state.content.output?.copy != null) updateColorPickerOutputCopyLabel(state, state.content.output.copy.button);
|
|
348
|
+
}
|
|
349
|
+
function onColorPickerOutputValue(event, state) {
|
|
350
|
+
const input = findAncestor(event, COLOR_PICKER_SELECTOR_OUTPUT_INPUT);
|
|
351
|
+
if (!(input instanceof HTMLInputElement)) return;
|
|
352
|
+
const color = input.dataset.color;
|
|
353
|
+
const property = input.dataset.property;
|
|
354
|
+
if (color == null || property == null) return;
|
|
355
|
+
if (outputTimer != null) clearTimeout(outputTimer);
|
|
356
|
+
outputTimer = setTimeout(() => {
|
|
357
|
+
outputTimer = void 0;
|
|
358
|
+
state.color.value[color] = {
|
|
359
|
+
...state.color.value[color],
|
|
360
|
+
[property]: input.valueAsNumber
|
|
361
|
+
};
|
|
362
|
+
setColorPickerValues(state, false);
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
function onEnter(state) {
|
|
366
|
+
const { alpha, anchor, color, internals } = state;
|
|
367
|
+
const input = anchor.input.value.replace(COLOR_PICKER_EXPRESSION_HEX_PREFIX, "");
|
|
368
|
+
const short = alpha ? input.length === 4 : input.length === 3;
|
|
369
|
+
if (isHexColor(input, alpha) && short) anchor.input.value = color.value.toHexString(alpha);
|
|
370
|
+
internals.form?.requestSubmit();
|
|
371
|
+
}
|
|
372
|
+
function onKeydown(event) {
|
|
373
|
+
if (colorPickerMovement.parameters != null && event.key === "Escape") {
|
|
374
|
+
cancelMove(colorPickerMovement.parameters);
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
const knob = findAncestor(event, COLOR_PICKER_SELECTOR_WELL_KNOB);
|
|
378
|
+
if (!(event.key === "Enter" && findAncestor(event, COLOR_PICKER_SELECTOR_INPUT) != null || COLOR_PICKER_KEYS.has(event.key) && knob != null)) return;
|
|
379
|
+
const state = colorPickerMap.get(findAncestor(event, COLOR_PICKER_TAGNAME));
|
|
380
|
+
if (state == null || state.disabled || state.readonly) return;
|
|
381
|
+
event.preventDefault();
|
|
382
|
+
if (event.key === "Enter") {
|
|
383
|
+
onEnter(state);
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
if (knob == null) return;
|
|
387
|
+
const modifier = event.shiftKey ? 10 : 1;
|
|
388
|
+
let { lightness, saturation } = state.color.value.hsl;
|
|
389
|
+
switch (event.key) {
|
|
390
|
+
case "ArrowDown":
|
|
391
|
+
lightness -= 1 * modifier;
|
|
392
|
+
break;
|
|
393
|
+
case "ArrowLeft":
|
|
394
|
+
saturation -= 1 * modifier;
|
|
395
|
+
break;
|
|
396
|
+
case "ArrowRight":
|
|
397
|
+
saturation += 1 * modifier;
|
|
398
|
+
break;
|
|
399
|
+
case "ArrowUp":
|
|
400
|
+
lightness += 1 * modifier;
|
|
401
|
+
break;
|
|
402
|
+
case "End":
|
|
403
|
+
lightness = 0;
|
|
404
|
+
break;
|
|
405
|
+
case "Home":
|
|
406
|
+
lightness = 100;
|
|
407
|
+
break;
|
|
408
|
+
case "PageDown":
|
|
409
|
+
lightness -= 10;
|
|
410
|
+
break;
|
|
411
|
+
case "PageUp": lightness += 10;
|
|
412
|
+
}
|
|
413
|
+
state.color.value.hsl = {
|
|
414
|
+
...state.color.value.hsl,
|
|
415
|
+
lightness: clamp(lightness, 0, 100),
|
|
416
|
+
saturation: clamp(saturation, 0, 100)
|
|
417
|
+
};
|
|
418
|
+
setColorPickerValues(state, false);
|
|
419
|
+
}
|
|
420
|
+
function onPointerdown(event) {
|
|
421
|
+
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey || (supportsTouch.value ? event.type === "mousedown" : event.type === "touchstart" || event.button !== 0)) return;
|
|
422
|
+
const well = findAncestor(event, COLOR_PICKER_SELECTOR_WELL);
|
|
423
|
+
if (well == null) return;
|
|
424
|
+
const element = findAncestor(event, COLOR_PICKER_TAGNAME);
|
|
425
|
+
if (element == null) return;
|
|
426
|
+
if (supportsTouch.value) event.preventDefault();
|
|
427
|
+
if (getEventPosition(event) == null) return;
|
|
428
|
+
const state = colorPickerMap.get(element);
|
|
429
|
+
if (state == null || state.disabled || state.readonly) return;
|
|
430
|
+
colorPickerMovement.parameters = {
|
|
431
|
+
state,
|
|
432
|
+
rectangle: well.getBoundingClientRect(),
|
|
433
|
+
value: state.color.value.hexa
|
|
434
|
+
};
|
|
435
|
+
styleToggler.set();
|
|
436
|
+
}
|
|
437
|
+
function onPointermove(event) {
|
|
438
|
+
if (colorPickerMovement.parameters == null) return;
|
|
439
|
+
const position = getEventPosition(event);
|
|
440
|
+
if (position != null) updateColorPickerValues(colorPickerMovement.parameters, position);
|
|
441
|
+
}
|
|
442
|
+
function onPointerup(event) {
|
|
443
|
+
if (colorPickerMovement.parameters == null) return;
|
|
444
|
+
const position = getEventPosition(event);
|
|
445
|
+
if (position != null) updateColorPickerValues(colorPickerMovement.parameters, position);
|
|
446
|
+
colorPickerMovement.parameters = void 0;
|
|
447
|
+
styleToggler.remove();
|
|
448
|
+
}
|
|
449
|
+
function updateColorPickerCopy(copy, attribute) {
|
|
450
|
+
const { button } = copy;
|
|
451
|
+
setAttribute(button, attribute, "");
|
|
452
|
+
copy.timer = setTimeout(() => {
|
|
453
|
+
copy.timer = void 0;
|
|
454
|
+
setAttribute(button, attribute, void 0);
|
|
455
|
+
}, styleTime);
|
|
456
|
+
}
|
|
457
|
+
function updateColorPickerValues(parameters, position) {
|
|
458
|
+
const { rectangle, state } = parameters;
|
|
459
|
+
const { x, y } = position;
|
|
460
|
+
const top = clamp((y - rectangle.top) / rectangle.height, 0, 1);
|
|
461
|
+
const left = clamp((x - rectangle.left) / rectangle.width, 0, 1);
|
|
462
|
+
state.color.value.hsl = {
|
|
463
|
+
...state.color.value.hsl,
|
|
464
|
+
lightness: (1 - top) * 100,
|
|
465
|
+
saturation: left * 100
|
|
466
|
+
};
|
|
467
|
+
setColorPickerValues(state, true);
|
|
468
|
+
}
|
|
469
|
+
const styleToggler = toggleStyles(document.body, {
|
|
470
|
+
touchAction: "none",
|
|
471
|
+
userSelect: "none",
|
|
472
|
+
webkitUserSelect: "none"
|
|
473
|
+
});
|
|
474
|
+
const colorPickerMovement = {};
|
|
475
|
+
const styleTime = 2500;
|
|
476
|
+
let outputTimer;
|
|
477
|
+
on(document, "click", onClick);
|
|
478
|
+
on(document, "keydown", onKeydown, { passive: false });
|
|
479
|
+
on(document, "mousedown", onPointerdown);
|
|
480
|
+
on(document, "pointermove", onPointermove);
|
|
481
|
+
on(document, "pointerup", onPointerup);
|
|
482
|
+
on(document, "touchcancel", onPointerup);
|
|
483
|
+
on(document, "touchstart", onPointerdown, { passive: false });
|
|
484
|
+
//#endregion
|
|
485
|
+
export { attachColorPicker as _, onColorPickerOutputFormat as a, detachColorPicker as b, getColorPickerOutput as c, setColorPickerLocalizations as d, setColorPickerRequired as f, updateColorPickerLocalizations as g, updateColorPickerLabels as h, onColorPickerOpacity as i, getColorPickerValueType as l, setColorPickerValues as m, onColorPickerHue as n, onColorPickerOutputValue as o, setColorPickerValue as p, onColorPickerInput as r, getColorPickerId as s, colorPickerMovement as t, setColorPickerDisabled as u, colorPickerMap as v, initializeColorPicker as x, colorPickerSet as y };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OuiFloatablePosition, c as getOnBeforeToggleListener, i as OuiFloatableOptions, l as removeFloatable, n as CreateOuiFloatableOptions, o as createEmbeddedFloatable, r as OuiFloatable, s as createFloatable, t as ATTRIBUTE_FLOATABLE } from "../floatable.embedded-
|
|
1
|
+
import { a as OuiFloatablePosition, c as getOnBeforeToggleListener, i as OuiFloatableOptions, l as removeFloatable, n as CreateOuiFloatableOptions, o as createEmbeddedFloatable, r as OuiFloatable, s as createFloatable, t as ATTRIBUTE_FLOATABLE } from "../floatable.embedded-DQYkXt8X.mjs";
|
|
2
2
|
export { ATTRIBUTE_FLOATABLE, CreateOuiFloatableOptions, OuiFloatable, OuiFloatableOptions, OuiFloatablePosition, createEmbeddedFloatable, createFloatable, getOnBeforeToggleListener, removeFloatable };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getAria } from "@oscarpalmer/toretto/aria";
|
|
2
|
-
import { getAttribute, setAttribute } from "@oscarpalmer/toretto/attribute";
|
|
3
2
|
import { on } from "@oscarpalmer/toretto/event";
|
|
4
|
-
import { setStyle, setStyles } from "@oscarpalmer/toretto/style";
|
|
5
3
|
import { isPlainObject } from "@oscarpalmer/atoms/is";
|
|
4
|
+
import { getAttribute, setAttribute } from "@oscarpalmer/toretto/attribute";
|
|
6
5
|
import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
|
|
6
|
+
import { setStyle, setStyles } from "@oscarpalmer/toretto/style";
|
|
7
7
|
//#region src/js/floatable/floatable.embedded.ts
|
|
8
8
|
var OuiFloatable = class {
|
|
9
9
|
#destroyed = false;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OuiFloatablePosition, n as CreateOuiFloatableOptions, r as OuiFloatable, s as createFloatable } from "../floatable.embedded-
|
|
1
|
+
import { a as OuiFloatablePosition, n as CreateOuiFloatableOptions, r as OuiFloatable, s as createFloatable } from "../floatable.embedded-DQYkXt8X.mjs";
|
|
2
2
|
export { type CreateOuiFloatableOptions, type OuiFloatable, type OuiFloatablePosition, createFloatable };
|
|
@@ -45,7 +45,7 @@ type OuiFloatableOptions = {
|
|
|
45
45
|
position: OuiFloatablePosition;
|
|
46
46
|
reusable: boolean;
|
|
47
47
|
};
|
|
48
|
-
type OuiFloatablePosition =
|
|
48
|
+
type OuiFloatablePosition = "above" | "above-end" | "above-start" | "below" | "below-end" | "below-start" | "end" | "end-bottom" | "end-top" | "start" | "start-bottom" | "start-top";
|
|
49
49
|
type OuiFloatableState = {
|
|
50
50
|
anchor: HTMLElement;
|
|
51
51
|
content: HTMLElement;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OuiFocusTrapOptions, i as OuiFocusTrap, n as ATTRIBUTE_FOCUSTRAP_CONTAIN, o as createFocusTrap, r as ATTRIBUTE_FOCUSTRAP_NOESCAPE, s as removeFocusTrap, t as ATTRIBUTE_FOCUSTRAP } from "../focus-trap.embedded-
|
|
1
|
+
import { a as OuiFocusTrapOptions, i as OuiFocusTrap, n as ATTRIBUTE_FOCUSTRAP_CONTAIN, o as createFocusTrap, r as ATTRIBUTE_FOCUSTRAP_NOESCAPE, s as removeFocusTrap, t as ATTRIBUTE_FOCUSTRAP } from "../focus-trap.embedded-CjyFQYow.mjs";
|
|
2
2
|
export { ATTRIBUTE_FOCUSTRAP, ATTRIBUTE_FOCUSTRAP_CONTAIN, ATTRIBUTE_FOCUSTRAP_NOESCAPE, OuiFocusTrap, OuiFocusTrapOptions, createFocusTrap, removeFocusTrap };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { attributable } from "../internal/attributable.mjs";
|
|
2
|
-
import { clamp } from "@oscarpalmer/atoms/number";
|
|
3
|
-
import { setAttribute } from "@oscarpalmer/toretto/attribute";
|
|
4
2
|
import { dispatch, on } from "@oscarpalmer/toretto/event";
|
|
5
|
-
import { findAncestor } from "@oscarpalmer/toretto/find";
|
|
6
3
|
import { isPlainObject } from "@oscarpalmer/atoms/is";
|
|
4
|
+
import { setAttribute } from "@oscarpalmer/toretto/attribute";
|
|
7
5
|
import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
|
|
6
|
+
import { clamp } from "@oscarpalmer/atoms/number";
|
|
7
|
+
import { findAncestor } from "@oscarpalmer/toretto/find";
|
|
8
8
|
import { getFocusable } from "@oscarpalmer/toretto/focusable";
|
|
9
9
|
//#region src/js/focus-trap/focus-trap.embedded.ts
|
|
10
10
|
var OuiFocusTrap = class {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OuiFocusTrapOptions, i as OuiFocusTrap, o as createFocusTrap } from "../focus-trap.embedded-
|
|
1
|
+
import { a as OuiFocusTrapOptions, i as OuiFocusTrap, o as createFocusTrap } from "../focus-trap.embedded-CjyFQYow.mjs";
|
|
2
2
|
export { type OuiFocusTrap, type OuiFocusTrapOptions, createFocusTrap };
|
|
@@ -70,7 +70,7 @@ type OuiFocusTrapState = {
|
|
|
70
70
|
declare function createFocusTrap(element: HTMLElement, options?: OuiFocusTrapOptions): OuiFocusTrap;
|
|
71
71
|
declare function removeFocusTrap(element: HTMLElement): void;
|
|
72
72
|
declare const ATTRIBUTE_FOCUSTRAP = "oui-focus-trap";
|
|
73
|
-
declare const ATTRIBUTE_FOCUSTRAP_CONTAIN
|
|
74
|
-
declare const ATTRIBUTE_FOCUSTRAP_NOESCAPE
|
|
73
|
+
declare const ATTRIBUTE_FOCUSTRAP_CONTAIN: string;
|
|
74
|
+
declare const ATTRIBUTE_FOCUSTRAP_NOESCAPE: string;
|
|
75
75
|
//#endregion
|
|
76
76
|
export { OuiFocusTrapOptions as a, OuiFocusTrap as i, ATTRIBUTE_FOCUSTRAP_CONTAIN as n, createFocusTrap as o, ATTRIBUTE_FOCUSTRAP_NOESCAPE as r, removeFocusTrap as s, ATTRIBUTE_FOCUSTRAP as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as OuiLocalizations } from "./l10n-Bn-7RcwR.mjs";
|
|
2
|
-
import { d as OuiListboxType, n as OuiListboxAutoComplete, o as OuiListboxLocalizations } from "./listbox.model-
|
|
3
|
-
import { c as COMBOBOX_TAGNAME } from "./constants.combobox-
|
|
2
|
+
import { d as OuiListboxType, n as OuiListboxAutoComplete, o as OuiListboxLocalizations } from "./listbox.model-BHPA7GM4.mjs";
|
|
3
|
+
import { c as COMBOBOX_TAGNAME } from "./constants.combobox-8EMRmv09.mjs";
|
|
4
4
|
//#region src/js/combobox/misc.combobox.d.ts
|
|
5
5
|
declare function getComboboxAutoComplete(element: OuiComboboxElement, select: boolean): OuiListboxAutoComplete;
|
|
6
6
|
declare function getComboboxId(): string;
|
package/dist/js/index.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as setComboboxLocalizations, t as OuiComboboxElement } from "./index-
|
|
4
|
-
import { d as OuiSortable, f as createSortable, g as createMovable, h as OuiMovable, t as CreateOuiDraggableOptions } from "./draggable-
|
|
1
|
+
import { a as OuiFloatablePosition, n as CreateOuiFloatableOptions, r as OuiFloatable, s as createFloatable } from "./floatable.embedded-DQYkXt8X.mjs";
|
|
2
|
+
import { A as OuiColorPickerEvent, B as OuiColorPickerElement, G as setColorPickerLocalizations } from "./constants.color-picker-B-gFjL8m.mjs";
|
|
3
|
+
import { a as setComboboxLocalizations, t as OuiComboboxElement } from "./index-C5D3-oiI.mjs";
|
|
4
|
+
import { d as OuiSortable, f as createSortable, g as createMovable, h as OuiMovable, t as CreateOuiDraggableOptions } from "./draggable-B5-70SZm.mjs";
|
|
5
5
|
import "./movable/movable.standalone.mjs";
|
|
6
|
-
import { a as createResizable, n as OuiResizable, t as CreateOuiResizableOptions } from "./resizable.embedded-
|
|
6
|
+
import { a as createResizable, n as OuiResizable, t as CreateOuiResizableOptions } from "./resizable.embedded-dvhdfQgt.mjs";
|
|
7
7
|
import "./resizable/resizable.standalone.mjs";
|
|
8
8
|
import { OuiDialog, getDialog } from "./dialog.mjs";
|
|
9
9
|
import "./floatable/floatable.standalone.mjs";
|
|
10
|
-
import { a as OuiFocusTrapOptions, i as OuiFocusTrap, o as createFocusTrap } from "./focus-trap.embedded-
|
|
11
|
-
import { n as setListboxLocalizations } from "./misc.listbox-
|
|
10
|
+
import { a as OuiFocusTrapOptions, i as OuiFocusTrap, o as createFocusTrap } from "./focus-trap.embedded-CjyFQYow.mjs";
|
|
11
|
+
import { n as setListboxLocalizations } from "./misc.listbox-mZMuYOxg.mjs";
|
|
12
12
|
import { OuiListboxElement } from "./listbox/index.mjs";
|
|
13
13
|
import { OuiPopover, getPopover } from "./popover.mjs";
|
|
14
14
|
import "./sortable/sortable.standalone.mjs";
|
package/dist/js/index.mjs
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { createFloatable } from "./floatable/floatable.embedded.mjs";
|
|
2
|
-
import { OuiColorPickerElement, OuiColorPickerEvent, setColorPickerLocalizations } from "./color-picker.mjs";
|
|
3
2
|
import { createMovable } from "./movable/movable.embedded.mjs";
|
|
4
3
|
import "./movable/movable.standalone.mjs";
|
|
5
4
|
import { createResizable } from "./resizable/resizable.embedded.mjs";
|
|
6
5
|
import { getDialog } from "./dialog.mjs";
|
|
7
6
|
import "./menu.mjs";
|
|
8
7
|
import "./toolbar.mjs";
|
|
9
|
-
import {
|
|
8
|
+
import { OuiColorPickerEvent } from "./color-picker/models.color-picker.mjs";
|
|
9
|
+
import { d as setColorPickerLocalizations } from "./event.color-picker-BEpq0Adu.mjs";
|
|
10
|
+
import { OuiColorPickerElement } from "./color-picker/index.mjs";
|
|
11
|
+
import { D as setComboboxLocalizations } from "./state.combobox-BWDFHwoi.mjs";
|
|
10
12
|
import { OuiComboboxElement } from "./combobox/index.mjs";
|
|
11
13
|
import "./floatable/floatable.standalone.mjs";
|
|
12
14
|
import { createFocusTrap } from "./focus-trap/focus-trap.embedded.mjs";
|
|
13
15
|
import "./focus-trap/focus-trap.standalone.mjs";
|
|
14
|
-
import { n as setListboxLocalizations } from "./misc.listbox-
|
|
16
|
+
import { n as setListboxLocalizations } from "./misc.listbox-DKB-j0UK.mjs";
|
|
15
17
|
import { OuiListboxElement } from "./listbox/index.mjs";
|
|
16
18
|
import { getPopover } from "./popover.mjs";
|
|
17
19
|
import "./resizable/resizable.standalone.mjs";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
//#region src/js/internal/attributable.d.ts
|
|
2
|
-
declare function attributable(attribute: string, add: (element: HTMLElement) => void, remove: (element: HTMLElement) => void): void;
|
|
3
|
-
//#endregion
|
|
4
|
-
export { attributable };
|
|
2
|
+
export declare function attributable(attribute: string, add: (element: HTMLElement) => void, remove: (element: HTMLElement) => void): void;
|
|
3
|
+
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OuiDraggableGlobals, c as addDraggable, i as OuiDraggableBound, l as getDraggableStates, n as OuiDragMovePosition, o as OuiDraggableItem, r as OuiDraggable, s as OuiDraggableState, t as CreateOuiDraggableOptions, u as removeDraggable } from "../draggable-
|
|
1
|
+
import { a as OuiDraggableGlobals, c as addDraggable, i as OuiDraggableBound, l as getDraggableStates, n as OuiDragMovePosition, o as OuiDraggableItem, r as OuiDraggable, s as OuiDraggableState, t as CreateOuiDraggableOptions, u as removeDraggable } from "../draggable-B5-70SZm.mjs";
|
|
2
2
|
export { CreateOuiDraggableOptions, OuiDragMovePosition, OuiDraggable, OuiDraggableBound, OuiDraggableGlobals, OuiDraggableItem, OuiDraggableState, addDraggable, getDraggableStates, removeDraggable };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { clamp } from "@oscarpalmer/atoms/number";
|
|
2
|
-
import { getAttribute, setAttribute } from "@oscarpalmer/toretto/attribute";
|
|
3
1
|
import { dispatch, getEventPosition, on } from "@oscarpalmer/toretto/event";
|
|
4
|
-
import {
|
|
5
|
-
import { setStyle, setStyles, toggleStyles } from "@oscarpalmer/toretto/style";
|
|
6
|
-
import supportsTouch from "@oscarpalmer/toretto/touch";
|
|
2
|
+
import { getAttribute, setAttribute } from "@oscarpalmer/toretto/attribute";
|
|
7
3
|
import { isHTMLOrSVGElement } from "@oscarpalmer/toretto/is";
|
|
4
|
+
import { setStyle, setStyles, toggleStyles } from "@oscarpalmer/toretto/style";
|
|
5
|
+
import { clamp } from "@oscarpalmer/atoms/number";
|
|
6
|
+
import { findAncestor } from "@oscarpalmer/toretto/find";
|
|
7
|
+
import { supportsTouch } from "@oscarpalmer/toretto/touch";
|
|
8
8
|
//#region src/js/internal/draggable.ts
|
|
9
9
|
var OuiDraggable = class {
|
|
10
10
|
#destroyed = false;
|