xmlui 0.10.16 → 0.10.19

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.
Files changed (78) hide show
  1. package/dist/lib/{index-D4RYJasT.mjs → index-cuh97e2e.mjs} +1603 -1635
  2. package/dist/lib/index.css +1 -1
  3. package/dist/lib/{initMock-qzTZlH-6.mjs → initMock-BMxsanHc.mjs} +1 -1
  4. package/dist/lib/xmlui.mjs +1 -1
  5. package/dist/metadata/{collectedComponentMetadata-BQaefK3f.mjs → collectedComponentMetadata-Cp-9lpnG.mjs} +1716 -1757
  6. package/dist/metadata/{initMock-Cz6QssI3.mjs → initMock-C-cnv--V.mjs} +1 -1
  7. package/dist/metadata/style.css +1 -1
  8. package/dist/metadata/xmlui-metadata.mjs +1 -1
  9. package/dist/metadata/xmlui-metadata.umd.js +3 -3
  10. package/dist/scripts/package.json +1 -1
  11. package/dist/scripts/src/components/Accordion/Accordion.spec.js +1 -1
  12. package/dist/scripts/src/components/Accordion/AccordionItemNative.js +1 -1
  13. package/dist/scripts/src/components/AutoComplete/AutoComplete.spec.js +54 -4
  14. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +81 -62
  15. package/dist/scripts/src/components/Checkbox/Checkbox.js +1 -5
  16. package/dist/scripts/src/components/Checkbox/Checkbox.spec.js +5 -0
  17. package/dist/scripts/src/components/ColorPicker/ColorPicker.js +2 -6
  18. package/dist/scripts/src/components/ColorPicker/ColorPicker.spec.js +29 -0
  19. package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +12 -9
  20. package/dist/scripts/src/components/ComponentProvider.js +2 -0
  21. package/dist/scripts/src/components/DateInput/DateInput.js +1 -5
  22. package/dist/scripts/src/components/DateInput/DateInput.spec.js +51 -17
  23. package/dist/scripts/src/components/DateInput/DateInputNative.js +12 -16
  24. package/dist/scripts/src/components/DatePicker/DatePicker.js +14 -13
  25. package/dist/scripts/src/components/DatePicker/DatePicker.spec.js +50 -18
  26. package/dist/scripts/src/components/DatePicker/DatePickerNative.js +34 -32
  27. package/dist/scripts/src/components/FileInput/FileInput.js +1 -5
  28. package/dist/scripts/src/components/FileInput/FileInput.spec.js +36 -0
  29. package/dist/scripts/src/components/FileInput/FileInputNative.js +14 -15
  30. package/dist/scripts/src/components/Form/Form.spec.js +11 -9
  31. package/dist/scripts/src/components/Form/FormNative.js +15 -9
  32. package/dist/scripts/src/components/FormItem/FormItem.spec.js +179 -30
  33. package/dist/scripts/src/components/FormItem/FormItemNative.js +20 -22
  34. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +8 -17
  35. package/dist/scripts/src/components/FormItem/Validations.js +25 -6
  36. package/dist/scripts/src/components/Icon/Icon.js +1 -1
  37. package/dist/scripts/src/components/Input/PartialInput.js +2 -2
  38. package/dist/scripts/src/components/NumberBox/NumberBox.js +1 -5
  39. package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +38 -4
  40. package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +15 -17
  41. package/dist/scripts/src/components/RadioGroup/RadioGroup.js +1 -5
  42. package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +9 -0
  43. package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +4 -5
  44. package/dist/scripts/src/components/RadioGroup/RadioItem.js +28 -0
  45. package/dist/scripts/src/components/Select/Select.js +1 -5
  46. package/dist/scripts/src/components/Select/Select.spec.js +290 -193
  47. package/dist/scripts/src/components/Select/SelectNative.js +26 -32
  48. package/dist/scripts/src/components/Slider/Slider.js +1 -5
  49. package/dist/scripts/src/components/Slider/Slider.spec.js +36 -0
  50. package/dist/scripts/src/components/Slider/SliderNative.js +18 -19
  51. package/dist/scripts/src/components/Switch/Switch.js +1 -5
  52. package/dist/scripts/src/components/Switch/Switch.spec.js +24 -17
  53. package/dist/scripts/src/components/Table/Table.js +11 -1
  54. package/dist/scripts/src/components/Table/Table.spec.js +272 -0
  55. package/dist/scripts/src/components/Table/TableNative.js +162 -5
  56. package/dist/scripts/src/components/TextArea/TextArea.js +1 -5
  57. package/dist/scripts/src/components/TextArea/TextArea.spec.js +80 -0
  58. package/dist/scripts/src/components/TextArea/TextAreaNative.js +8 -29
  59. package/dist/scripts/src/components/TextBox/TextBox.spec.js +45 -7
  60. package/dist/scripts/src/components/TextBox/TextBoxNative.js +2 -2
  61. package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +75 -37
  62. package/dist/scripts/src/components/TimeInput/TimeInputNative.js +6 -20
  63. package/dist/scripts/src/components/Timer/Timer.spec.js +66 -96
  64. package/dist/scripts/src/components/Toggle/Toggle.js +30 -25
  65. package/dist/scripts/src/components/Tree/Tree-icons.spec.js +206 -0
  66. package/dist/scripts/src/components/Tree/Tree.spec.js +1 -94
  67. package/dist/scripts/src/components/Tree/TreeComponent.js +44 -7
  68. package/dist/scripts/src/components/Tree/TreeNative.js +127 -85
  69. package/dist/scripts/src/components/Tree/testData.js +25 -1
  70. package/dist/scripts/src/components-core/behaviors/Behavior.js +2 -0
  71. package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +8 -5
  72. package/dist/scripts/src/components-core/rendering/AppRoot.js +1 -2
  73. package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +12 -13
  74. package/dist/scripts/src/components-core/utils/treeUtils.js +8 -5
  75. package/dist/scripts/src/testing/ComponentDrivers.js +2 -4
  76. package/dist/standalone/xmlui-standalone.umd.js +15 -15
  77. package/package.json +1 -1
  78. package/dist/scripts/src/components-core/behaviors/BehaviorContext.js +0 -54
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmlui",
3
- "version": "0.10.16",
3
+ "version": "0.10.19",
4
4
  "sideEffects": false,
5
5
  "scripts": {
6
6
  "start-test-bed": "cd src/testing/infrastructure && xmlui start",
@@ -66,7 +66,7 @@ const CODE = `
66
66
  const content = page.getByText("Content");
67
67
  yield (0, fixtures_1.expect)(content).not.toBeVisible();
68
68
  yield header.focus();
69
- page.keyboard.press("Enter");
69
+ yield page.keyboard.press("Enter");
70
70
  yield (0, fixtures_1.expect)(content).toBeVisible();
71
71
  }));
72
72
  // =============================================================================
@@ -68,7 +68,7 @@ exports.AccordionItemComponent = (0, react_1.forwardRef)(function AccordionItemC
68
68
  const itemId = (0, react_1.useMemo)(() => (id ? `${id}` : generatedId), [id, generatedId]);
69
69
  const triggerId = (0, react_1.useMemo)(() => `trigger_${itemId}`, [itemId]);
70
70
  const { rotateExpanded, expandedItems, hideIcon, expandedIcon, collapsedIcon, triggerPosition, expandItem, register, unRegister, } = (0, AccordionContext_1.useAccordionContext)();
71
- const expanded = (0, react_1.useMemo)(() => expandedItems.includes(itemId), [itemId, expandedItems]);
71
+ const expanded = (0, react_1.useMemo)(() => (expandedItems !== null && expandedItems !== void 0 ? expandedItems : []).includes(itemId), [itemId, expandedItems]);
72
72
  const [initialised, setInitialised] = (0, react_1.useState)(false);
73
73
  (0, react_1.useEffect)(() => {
74
74
  if (!initialised) {
@@ -257,6 +257,29 @@ const fixtures_1 = require("../../testing/fixtures");
257
257
  yield page.keyboard.press("Tab");
258
258
  yield (0, fixtures_1.expect)(page.getByTestId("focusText")).toHaveText("AutoComplete lost focus");
259
259
  }));
260
+ (0, fixtures_1.test)("gotFocus and lostFocus events by clicking on label work correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, }) {
261
+ yield initTestBed(`
262
+ <App var.isFocused="false">
263
+ <Text testId="focusText">{isFocused === true ? 'AutoComplete focused' : 'AutoComplete lost focus'}</Text>
264
+ <AutoComplete
265
+ id="autoComplete"
266
+ label="Select a hero"
267
+ onGotFocus="isFocused = true"
268
+ onLostFocus="isFocused = false"
269
+ >
270
+ <Option value="1" label="Bruce Wayne" />
271
+ </AutoComplete>
272
+ </App>
273
+ `);
274
+ // Initial state
275
+ yield (0, fixtures_1.expect)(page.getByTestId("focusText")).toHaveText("AutoComplete lost focus");
276
+ // Focus the autocomplete
277
+ yield page.getByText("Select a hero").click();
278
+ yield (0, fixtures_1.expect)(page.getByTestId("focusText")).toHaveText("AutoComplete focused");
279
+ // Blur the autocomplete
280
+ yield page.keyboard.press("Tab");
281
+ yield (0, fixtures_1.expect)(page.getByTestId("focusText")).toHaveText("AutoComplete lost focus");
282
+ }));
260
283
  (0, fixtures_1.test)("setValue API works correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
261
284
  yield initTestBed(`
262
285
  <App>
@@ -334,10 +357,8 @@ const fixtures_1 = require("../../testing/fixtures");
334
357
  // =============================================================================
335
358
  // ACCESSIBILITY TESTS
336
359
  // =============================================================================
337
- (0, fixtures_1.test)("has appropriate ARIA attributes", // SKIP_REASON.XMLUI_BUG(
338
- // "There's a weird issue where the aria-expanded attribute is not set correctly on the input but it is on the wrapping div.",
339
- // ),
340
- (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
360
+ (0, fixtures_1.test)("has appropriate ARIA attributes", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
361
+ // ), // "There's a weird issue where the aria-expanded attribute is not set correctly on the input but it is on the wrapping div.", // SKIP_REASON.XMLUI_BUG(
341
362
  // TODO: review these Copilot-created tests
342
363
  yield initTestBed(`
343
364
  <AutoComplete label="Select a hero" placeholder="Search heroes">
@@ -381,3 +402,32 @@ const fixtures_1 = require("../../testing/fixtures");
381
402
  // Verify selection
382
403
  yield (0, fixtures_1.expect)(page.getByRole("combobox")).toHaveValue("Clark Kent");
383
404
  }));
405
+ // =============================================================================
406
+ // VISUAL STATE TESTS
407
+ // =============================================================================
408
+ (0, fixtures_1.test)("input has correct width in px", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
409
+ yield initTestBed(`<AutoComplete width="200px" testId="test"/>`, {});
410
+ const input = page.getByTestId("test");
411
+ const { width } = yield input.boundingBox();
412
+ (0, fixtures_1.expect)(width).toBe(200);
413
+ }));
414
+ (0, fixtures_1.test)("input with label has correct width in px", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
415
+ yield initTestBed(`<AutoComplete width="200px" label="test" testId="test"/>`, {});
416
+ const input = page.getByTestId("test");
417
+ const { width } = yield input.boundingBox();
418
+ (0, fixtures_1.expect)(width).toBe(200);
419
+ }));
420
+ (0, fixtures_1.test)("input has correct width in %", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
421
+ yield page.setViewportSize({ width: 400, height: 300 });
422
+ yield initTestBed(`<AutoComplete width="50%" testId="test"/>`, {});
423
+ const input = page.getByTestId("test");
424
+ const { width } = yield input.boundingBox();
425
+ (0, fixtures_1.expect)(width).toBe(200);
426
+ }));
427
+ (0, fixtures_1.test)("input with label has correct width in %", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
428
+ yield page.setViewportSize({ width: 400, height: 300 });
429
+ yield initTestBed(`<AutoComplete width="50%" label="test" testId="test"/>`, {});
430
+ const input = page.getByTestId("test");
431
+ const { width } = yield input.boundingBox();
432
+ (0, fixtures_1.expect)(width).toBe(200);
433
+ }));
@@ -49,18 +49,15 @@ exports.defaultProps = {
49
49
  initiallyOpen: false,
50
50
  };
51
51
  exports.AutoComplete = (0, react_1.forwardRef)(function AutoComplete(_a, forwardedRef) {
52
- var { id, initialValue, value, enabled = exports.defaultProps.enabled, placeholder, updateState = exports.defaultProps.updateState, validationStatus = exports.defaultProps.validationStatus, onDidChange = exports.defaultProps.onDidChange, onFocus = exports.defaultProps.onFocus, onBlur = exports.defaultProps.onBlur, onItemCreated = exports.defaultProps.onItemCreated, registerComponentApi, emptyListTemplate, style, className, children, readOnly = exports.defaultProps.readOnly, autoFocus = exports.defaultProps.autoFocus, dropdownHeight, multi = exports.defaultProps.multi, label, labelPosition, labelWidth, labelBreak, required = exports.defaultProps.required, creatable = exports.defaultProps.creatable, optionRenderer, initiallyOpen = exports.defaultProps.initiallyOpen } = _a, rest = __rest(_a, ["id", "initialValue", "value", "enabled", "placeholder", "updateState", "validationStatus", "onDidChange", "onFocus", "onBlur", "onItemCreated", "registerComponentApi", "emptyListTemplate", "style", "className", "children", "readOnly", "autoFocus", "dropdownHeight", "multi", "label", "labelPosition", "labelWidth", "labelBreak", "required", "creatable", "optionRenderer", "initiallyOpen"]);
52
+ var { id, initialValue, value, enabled = exports.defaultProps.enabled, placeholder, updateState = exports.defaultProps.updateState, validationStatus = exports.defaultProps.validationStatus, onDidChange = exports.defaultProps.onDidChange, onFocus = exports.defaultProps.onFocus, onBlur = exports.defaultProps.onBlur, onItemCreated = exports.defaultProps.onItemCreated, registerComponentApi, emptyListTemplate, style, className, children, readOnly = exports.defaultProps.readOnly, autoFocus = exports.defaultProps.autoFocus, dropdownHeight, multi = exports.defaultProps.multi, required = exports.defaultProps.required, creatable = exports.defaultProps.creatable, optionRenderer, initiallyOpen = exports.defaultProps.initiallyOpen } = _a, rest = __rest(_a, ["id", "initialValue", "value", "enabled", "placeholder", "updateState", "validationStatus", "onDidChange", "onFocus", "onBlur", "onItemCreated", "registerComponentApi", "emptyListTemplate", "style", "className", "children", "readOnly", "autoFocus", "dropdownHeight", "multi", "required", "creatable", "optionRenderer", "initiallyOpen"]);
53
53
  const [referenceElement, setReferenceElement] = (0, react_1.useState)(null);
54
54
  const inputRef = (0, react_1.useRef)(null);
55
55
  const [open, setOpen] = (0, react_1.useState)(initiallyOpen);
56
- const dropdownRef = (0, react_1.useRef)(null);
57
56
  const [options, setOptions] = (0, react_1.useState)(new Set());
58
57
  const [inputValue, setInputValue] = (0, react_1.useState)("");
59
58
  const { root } = (0, ThemeContext_1.useTheme)();
60
59
  const [width, setWidth] = (0, react_1.useState)(0);
61
60
  const observer = (0, react_1.useRef)();
62
- const generatedId = (0, react_1.useId)();
63
- const inputId = id || generatedId;
64
61
  const [searchTerm, setSearchTerm] = (0, react_1.useState)("");
65
62
  const [isFocused, setIsFocused] = (0, react_1.useState)(false);
66
63
  const [selectedIndex, setSelectedIndex] = (0, react_1.useState)(-1);
@@ -229,8 +226,8 @@ exports.AutoComplete = (0, react_1.forwardRef)(function AutoComplete(_a, forward
229
226
  var _a, _b;
230
227
  if (item.type === "creatable")
231
228
  return false;
232
- return ((_a = item.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === inputValue.toLowerCase() ||
233
- ((_b = item.value) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === inputValue.toLowerCase();
229
+ return (((_a = item.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === inputValue.toLowerCase() ||
230
+ ((_b = item.value) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === inputValue.toLowerCase());
234
231
  });
235
232
  if (matchingIndex !== -1) {
236
233
  setSelectedIndex(matchingIndex);
@@ -298,7 +295,18 @@ exports.AutoComplete = (0, react_1.forwardRef)(function AutoComplete(_a, forward
298
295
  setOpen(false);
299
296
  break;
300
297
  }
301
- }, [open, selectedIndex, allItems, searchTerm, onOptionAdd, onItemCreated, toggleOption, setOpen, findNextEnabledIndex, findPreviousEnabledIndex]);
298
+ }, [
299
+ open,
300
+ selectedIndex,
301
+ allItems,
302
+ searchTerm,
303
+ onOptionAdd,
304
+ onItemCreated,
305
+ toggleOption,
306
+ setOpen,
307
+ findNextEnabledIndex,
308
+ findPreviousEnabledIndex,
309
+ ]);
302
310
  // Render the "empty list" message
303
311
  const emptyListNode = (0, react_1.useMemo)(() => emptyListTemplate !== null && emptyListTemplate !== void 0 ? emptyListTemplate : ((0, jsx_runtime_1.jsxs)("div", { className: AutoComplete_module_scss_1.default.autoCompleteEmpty, children: [(0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "noresult" }), (0, jsx_runtime_1.jsx)("span", { children: "List is empty" })] })), [emptyListTemplate]);
304
312
  // Register component API for external interactions
@@ -332,8 +340,19 @@ exports.AutoComplete = (0, react_1.forwardRef)(function AutoComplete(_a, forward
332
340
  setSelectedIndex,
333
341
  optionRenderer,
334
342
  };
335
- }, [inputValue, searchTerm, multi, options, toggleOption, value, open, setOpen, setSelectedIndex, optionRenderer]);
336
- return ((0, jsx_runtime_1.jsx)(AutoCompleteContext_1.AutoCompleteContext.Provider, { value: autoCompleteContextValue, children: (0, jsx_runtime_1.jsx)(OptionContext_1.OptionContext.Provider, { value: optionContextValue, children: (0, jsx_runtime_1.jsxs)(OptionTypeProvider_1.default, { Component: HiddenOption_1.HiddenOption, children: [(0, jsx_runtime_1.jsx)(react_popover_1.Popover, { open: open, onOpenChange: (isOpen) => {
343
+ }, [
344
+ inputValue,
345
+ searchTerm,
346
+ multi,
347
+ options,
348
+ toggleOption,
349
+ value,
350
+ open,
351
+ setOpen,
352
+ setSelectedIndex,
353
+ optionRenderer,
354
+ ]);
355
+ return ((0, jsx_runtime_1.jsx)(AutoCompleteContext_1.AutoCompleteContext.Provider, { value: autoCompleteContextValue, children: (0, jsx_runtime_1.jsx)(OptionContext_1.OptionContext.Provider, { value: optionContextValue, children: (0, jsx_runtime_1.jsxs)(OptionTypeProvider_1.default, { Component: HiddenOption_1.HiddenOption, children: [(0, jsx_runtime_1.jsxs)(react_popover_1.Popover, { open: open, onOpenChange: (isOpen) => {
337
356
  if (readOnly)
338
357
  return;
339
358
  setOpen(isOpen);
@@ -341,62 +360,62 @@ exports.AutoComplete = (0, react_1.forwardRef)(function AutoComplete(_a, forward
341
360
  // Reset highlighted option when dropdown closes
342
361
  setSelectedIndex(-1);
343
362
  }
344
- }, modal: false, children: (0, jsx_runtime_1.jsxs)("div", { ref: dropdownRef, className: AutoComplete_module_scss_1.default.command, children: [(0, jsx_runtime_1.jsx)(react_popover_1.PopoverTrigger, { asChild: true, ref: setReferenceElement, children: (0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { ref: forwardedRef, "data-part-id": PART_LIST_WRAPPER, style: Object.assign({ width: "100%" }, style), className: (0, classnames_1.default)(className, AutoComplete_module_scss_1.default.badgeListWrapper, AutoComplete_module_scss_1.default[validationStatus], {
345
- [AutoComplete_module_scss_1.default.disabled]: !enabled,
346
- [AutoComplete_module_scss_1.default.focused]: isFocused,
347
- }), "aria-expanded": open, children: [Array.isArray(selectedValue) && selectedValue.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: AutoComplete_module_scss_1.default.badgeList, children: selectedValue.map((v, index) => ((0, jsx_runtime_1.jsxs)("span", { className: AutoComplete_module_scss_1.default.badge, children: [v === null || v === void 0 ? void 0 : v.label, !readOnly && ((0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "close", size: "sm", onClick: (event) => {
348
- event.stopPropagation();
349
- toggleOption(v.value);
350
- } }))] }, index))) })), (0, jsx_runtime_1.jsxs)("div", { className: AutoComplete_module_scss_1.default.inputWrapper, children: [(0, jsx_runtime_1.jsx)("input", { role: "combobox", id: inputId, onFocus: (ev) => {
351
- setIsFocused(true);
352
- onFocus(ev);
353
- }, onBlur: (ev) => {
354
- if (inputValue === "" && !multi) {
355
- clearValue();
363
+ }, modal: false, children: [(0, jsx_runtime_1.jsx)(react_popover_1.PopoverTrigger, { asChild: true, ref: setReferenceElement, children: (0, jsx_runtime_1.jsxs)("div", { style: style, "data-part-id": PART_LIST_WRAPPER, className: (0, classnames_1.default)(className, AutoComplete_module_scss_1.default.badgeListWrapper, AutoComplete_module_scss_1.default[validationStatus], {
364
+ [AutoComplete_module_scss_1.default.disabled]: !enabled,
365
+ [AutoComplete_module_scss_1.default.focused]: isFocused,
366
+ }), "aria-expanded": open, children: [Array.isArray(selectedValue) && selectedValue.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: AutoComplete_module_scss_1.default.badgeList, children: selectedValue.map((v, index) => ((0, jsx_runtime_1.jsxs)("span", { className: AutoComplete_module_scss_1.default.badge, children: [v === null || v === void 0 ? void 0 : v.label, !readOnly && ((0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "close", size: "sm", onClick: (event) => {
367
+ event.stopPropagation();
368
+ toggleOption(v.value);
369
+ } }))] }, index))) })), (0, jsx_runtime_1.jsxs)("div", { className: AutoComplete_module_scss_1.default.inputWrapper, children: [(0, jsx_runtime_1.jsx)("input", Object.assign({}, rest, { role: "combobox", id: id, ref: inputRef, onFocus: (ev) => {
370
+ setIsFocused(true);
371
+ onFocus(ev);
372
+ }, onBlur: (ev) => {
373
+ if (inputValue === "" && !multi) {
374
+ clearValue();
375
+ }
376
+ else {
377
+ if (!Array.isArray(selectedValue) && selectedValue) {
378
+ setInputValue(selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.label);
356
379
  }
357
380
  else {
358
- if (!Array.isArray(selectedValue) && selectedValue) {
359
- setInputValue(selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.label);
360
- }
361
- else {
362
- setInputValue("");
363
- }
364
- }
365
- onBlur(ev);
366
- setIsFocused(false);
367
- }, onKeyDown: (event) => {
368
- if (readOnly)
369
- return;
370
- // Handle opening dropdown
371
- if (event.key === "ArrowDown" && !open) {
372
- setOpen(true);
373
- return;
374
- }
375
- // Handle keyboard navigation when dropdown is open
376
- if (open) {
377
- handleKeyDown(event);
381
+ setInputValue("");
378
382
  }
379
- else if (event.key === "Enter") {
380
- setOpen(true);
381
- }
382
- }, "data-part-id": parts_1.PART_INPUT, readOnly: readOnly, autoFocus: autoFocus, "aria-autocomplete": "list", ref: inputRef, value: inputValue, disabled: !enabled, onChange: (event) => {
383
+ }
384
+ onBlur(ev);
385
+ setIsFocused(false);
386
+ }, onKeyDown: (event) => {
387
+ if (readOnly)
388
+ return;
389
+ // Handle opening dropdown
390
+ if (event.key === "ArrowDown" && !open) {
391
+ setOpen(true);
392
+ return;
393
+ }
394
+ // Handle keyboard navigation when dropdown is open
395
+ if (open) {
396
+ handleKeyDown(event);
397
+ }
398
+ else if (event.key === "Enter") {
383
399
  setOpen(true);
384
- setInputValue(event.target.value);
385
- setSearchTerm(event.target.value);
386
- }, placeholder: !readOnly ? placeholder : "", className: AutoComplete_module_scss_1.default.commandInput }), (0, jsx_runtime_1.jsxs)("div", { className: AutoComplete_module_scss_1.default.actions, children: [(value === null || value === void 0 ? void 0 : value.length) > 0 && enabled && !readOnly && ((0, jsx_runtime_1.jsx)("span", { className: AutoComplete_module_scss_1.default.action, onClick: (event) => {
387
- event.stopPropagation();
388
- clearValue();
389
- }, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "close" }) })), (0, jsx_runtime_1.jsx)("span", { className: AutoComplete_module_scss_1.default.action, onClick: () => {
390
- var _a;
391
- if (readOnly)
392
- return;
393
- setOpen(!open);
394
- // Focus the input after opening dropdown
395
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
396
- }, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" }) })] })] })] })) }), open && ((0, jsx_runtime_1.jsx)(react_popover_1.Portal, { container: root, children: (0, jsx_runtime_1.jsx)(react_popover_1.PopoverContent, { style: { width, height: dropdownHeight }, className: AutoComplete_module_scss_1.default.popoverContent, align: "start", onOpenAutoFocus: (e) => e.preventDefault(), children: (0, jsx_runtime_1.jsxs)("div", { role: "listbox", className: AutoComplete_module_scss_1.default.commandList, style: { height: dropdownHeight }, children: [filteredOptions.length === 0 && !shouldShowCreatable && ((0, jsx_runtime_1.jsx)("div", { children: emptyListNode })), shouldShowCreatable && ((0, jsx_runtime_1.jsx)(CreatableItem, { onNewItem: onItemCreated, isHighlighted: selectedIndex === 0 })), (0, jsx_runtime_1.jsx)("div", { children: filteredOptions.map(({ value, label, enabled, keywords }, index) => {
397
- const itemIndex = shouldShowCreatable ? index + 1 : index;
398
- return ((0, jsx_runtime_1.jsx)(AutoCompleteOption, { value: value, label: label, enabled: enabled, keywords: keywords, readOnly: readOnly, isHighlighted: selectedIndex === itemIndex, itemIndex: itemIndex }, value));
399
- }) })] }) }) }))] }) }), children] }) }) }));
400
+ }
401
+ }, "data-part-id": parts_1.PART_INPUT, readOnly: readOnly, autoFocus: autoFocus, "aria-autocomplete": "list", value: inputValue, disabled: !enabled, onChange: (event) => {
402
+ setOpen(true);
403
+ setInputValue(event.target.value);
404
+ setSearchTerm(event.target.value);
405
+ }, placeholder: !readOnly ? placeholder : "", className: AutoComplete_module_scss_1.default.commandInput })), (0, jsx_runtime_1.jsxs)("div", { className: AutoComplete_module_scss_1.default.actions, children: [(value === null || value === void 0 ? void 0 : value.length) > 0 && enabled && !readOnly && ((0, jsx_runtime_1.jsx)("span", { className: AutoComplete_module_scss_1.default.action, onClick: (event) => {
406
+ event.stopPropagation();
407
+ clearValue();
408
+ }, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "close" }) })), (0, jsx_runtime_1.jsx)("span", { className: AutoComplete_module_scss_1.default.action, onClick: () => {
409
+ var _a;
410
+ if (readOnly)
411
+ return;
412
+ setOpen(!open);
413
+ // Focus the input after opening dropdown
414
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
415
+ }, children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" }) })] })] })] }) }), open && ((0, jsx_runtime_1.jsx)(react_popover_1.Portal, { container: root, children: (0, jsx_runtime_1.jsx)(react_popover_1.PopoverContent, { style: { width, height: dropdownHeight }, className: AutoComplete_module_scss_1.default.popoverContent, align: "start", onOpenAutoFocus: (e) => e.preventDefault(), children: (0, jsx_runtime_1.jsxs)("div", { role: "listbox", className: AutoComplete_module_scss_1.default.commandList, style: { height: dropdownHeight }, children: [filteredOptions.length === 0 && !shouldShowCreatable && ((0, jsx_runtime_1.jsx)("div", { children: emptyListNode })), shouldShowCreatable && ((0, jsx_runtime_1.jsx)(CreatableItem, { onNewItem: onItemCreated, isHighlighted: selectedIndex === 0 })), (0, jsx_runtime_1.jsx)("div", { children: filteredOptions.map(({ value, label, enabled, keywords }, index) => {
416
+ const itemIndex = shouldShowCreatable ? index + 1 : index;
417
+ return ((0, jsx_runtime_1.jsx)(AutoCompleteOption, { value: value, label: label, enabled: enabled, keywords: keywords, readOnly: readOnly, isHighlighted: selectedIndex === itemIndex, itemIndex: itemIndex }, value));
418
+ }) })] }) }) }))] }), children] }) }) }));
400
419
  });
401
420
  function CreatableItem({ onNewItem, isHighlighted = false }) {
402
421
  const { value, options, searchTerm, onChange, setOpen, setSelectedIndex } = (0, AutoCompleteContext_1.useAutoComplete)();
@@ -432,7 +451,7 @@ function CreatableItem({ onNewItem, isHighlighted = false }) {
432
451
  function AutoCompleteOption(option) {
433
452
  const { value, label, enabled = true, keywords, readOnly, children, isHighlighted = false, itemIndex, } = option;
434
453
  const id = (0, react_1.useId)();
435
- const { value: selectedValue, onChange, multi, setOpen, setSelectedIndex, optionRenderer } = (0, AutoCompleteContext_1.useAutoComplete)();
454
+ const { value: selectedValue, onChange, multi, setOpen, setSelectedIndex, optionRenderer, } = (0, AutoCompleteContext_1.useAutoComplete)();
436
455
  const selected = multi ? selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.includes(value) : selectedValue === value;
437
456
  const handleClick = () => {
438
457
  if (!readOnly && enabled) {
@@ -28,10 +28,6 @@ exports.CheckboxMd = (0, metadata_helpers_1.createMetadata)({
28
28
  },
29
29
  props: {
30
30
  indeterminate: (0, metadata_helpers_1.dIndeterminate)(Toggle_1.defaultProps.indeterminate),
31
- label: (0, metadata_helpers_1.dLabel)(),
32
- labelPosition: (0, metadata_helpers_1.dLabelPosition)(exports.defaultProps.labelPosition),
33
- labelWidth: (0, metadata_helpers_1.dLabelWidth)(COMP),
34
- labelBreak: (0, metadata_helpers_1.dLabelBreak)(COMP),
35
31
  required: (0, metadata_helpers_1.dRequired)(),
36
32
  initialValue: (0, metadata_helpers_1.dInitialValue)(Toggle_1.defaultProps.initialValue),
37
33
  autoFocus: (0, metadata_helpers_1.dAutoFocus)(),
@@ -81,5 +77,5 @@ exports.checkboxComponentRenderer = (0, renderers_1.createComponentRenderer)(COM
81
77
  const inputTemplate = node.props.inputTemplate;
82
78
  return ((0, jsx_runtime_1.jsx)(Toggle_1.Toggle, { inputRenderer: inputTemplate
83
79
  ? (contextVars) => ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { contextVars: contextVars, node: inputTemplate, renderChild: renderChild, layoutContext: layoutContext }))
84
- : undefined, enabled: extractValue.asOptionalBoolean(node.props.enabled), className: className, initialValue: extractValue.asOptionalBoolean(node.props.initialValue, exports.defaultProps.initialValue), value: state === null || state === void 0 ? void 0 : state.value, readOnly: extractValue.asOptionalBoolean(node.props.readOnly), validationStatus: extractValue(node.props.validationStatus), updateState: updateState, onClick: lookupEventHandler("click"), onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), label: extractValue(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required), indeterminate: extractValue.asOptionalBoolean(node.props.indeterminate), registerComponentApi: registerComponentApi, autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus) }));
80
+ : undefined, enabled: extractValue.asOptionalBoolean(node.props.enabled), className: className, initialValue: extractValue.asOptionalBoolean(node.props.initialValue, exports.defaultProps.initialValue), value: state === null || state === void 0 ? void 0 : state.value, readOnly: extractValue.asOptionalBoolean(node.props.readOnly), validationStatus: extractValue(node.props.validationStatus), updateState: updateState, onClick: lookupEventHandler("click"), onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), required: extractValue.asOptionalBoolean(node.props.required), indeterminate: extractValue.asOptionalBoolean(node.props.indeterminate), registerComponentApi: registerComponentApi, autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus) }));
85
81
  });
@@ -503,6 +503,11 @@ fixtures_1.test.describe("Event Handling", () => {
503
503
  yield page.getByRole("checkbox").focus();
504
504
  yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("focused");
505
505
  }));
506
+ (0, fixtures_1.test)("gotFocus event fires on label click", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
507
+ const { testStateDriver } = yield initTestBed(`<Checkbox onGotFocus="testState = 'focused'" label="test" />`);
508
+ yield page.getByText("test").click();
509
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("focused");
510
+ }));
506
511
  (0, fixtures_1.test)("component lostFocus event fires on blur", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
507
512
  const { testStateDriver } = yield initTestBed(`<Checkbox onLostFocus="testState = 'blurred'" />`);
508
513
  yield page.getByRole("checkbox").focus();
@@ -16,10 +16,6 @@ exports.ColorPickerMd = (0, metadata_helpers_1.createMetadata)({
16
16
  description: "`ColorPicker` enables users to choose colors by specifying RGB, HSL, or HEX values.",
17
17
  props: {
18
18
  initialValue: (0, metadata_helpers_1.dInitialValue)(),
19
- label: (0, metadata_helpers_1.dLabel)(),
20
- labelPosition: (0, metadata_helpers_1.dLabelPosition)(),
21
- labelWidth: (0, metadata_helpers_1.dLabelWidth)(COMP),
22
- labelBreak: (0, metadata_helpers_1.dLabelBreak)(COMP),
23
19
  enabled: (0, metadata_helpers_1.dEnabled)(),
24
20
  autoFocus: (0, metadata_helpers_1.dAutoFocus)(),
25
21
  required: (0, metadata_helpers_1.dRequired)(),
@@ -51,8 +47,8 @@ exports.ColorPickerMd = (0, metadata_helpers_1.createMetadata)({
51
47
  themeVars: (0, themeVars_1.parseScssVar)(ColorPicker_module_scss_1.default.themeVars),
52
48
  });
53
49
  exports.colorPickerComponentRenderer = (0, renderers_1.createComponentRenderer)("ColorPicker", exports.ColorPickerMd, ({ node, extractValue, className, state, lookupEventHandler, registerComponentApi, updateState, }) => {
54
- var _a, _b, _c, _d, _e, _f, _g, _h;
50
+ var _a, _b, _c, _d;
55
51
  const readOnly = extractValue.asOptionalBoolean((_a = node.props) === null || _a === void 0 ? void 0 : _a.readOnly, false);
56
52
  const enabled = extractValue.asOptionalBoolean((_b = node.props) === null || _b === void 0 ? void 0 : _b.enabled, true);
57
- return ((0, jsx_runtime_1.jsx)(ColorPickerNative_1.ColorPicker, { validationStatus: extractValue(node.props.validationStatus), value: state.value, initialValue: extractValue(node.props.initialValue), updateState: updateState, onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), registerComponentApi: registerComponentApi, className: className, required: extractValue.asOptionalBoolean((_c = node.props) === null || _c === void 0 ? void 0 : _c.required), enabled: enabled && !readOnly, readOnly: readOnly, autoFocus: extractValue.asOptionalBoolean((_d = node.props) === null || _d === void 0 ? void 0 : _d.autoFocus), label: extractValue((_e = node.props) === null || _e === void 0 ? void 0 : _e.label), labelPosition: extractValue((_f = node.props) === null || _f === void 0 ? void 0 : _f.labelPosition), labelBreak: extractValue((_g = node.props) === null || _g === void 0 ? void 0 : _g.labelBreak), labelWidth: extractValue((_h = node.props) === null || _h === void 0 ? void 0 : _h.labelWidth) }));
53
+ return ((0, jsx_runtime_1.jsx)(ColorPickerNative_1.ColorPicker, { validationStatus: extractValue(node.props.validationStatus), value: state.value, initialValue: extractValue(node.props.initialValue), updateState: updateState, onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), registerComponentApi: registerComponentApi, className: className, required: extractValue.asOptionalBoolean((_c = node.props) === null || _c === void 0 ? void 0 : _c.required), enabled: enabled && !readOnly, readOnly: readOnly, autoFocus: extractValue.asOptionalBoolean((_d = node.props) === null || _d === void 0 ? void 0 : _d.autoFocus) }));
58
54
  });
@@ -281,3 +281,32 @@ const fixtures_1 = require("../../testing/fixtures");
281
281
  // Verify the focus event fired
282
282
  yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("focused");
283
283
  }));
284
+ // =============================================================================
285
+ // VISUAL STATE TESTS
286
+ // =============================================================================
287
+ (0, fixtures_1.test)("input has correct width in px", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
288
+ yield initTestBed(`<ColorPicker width="200px" testId="test"/>`, {});
289
+ const input = page.getByTestId("test");
290
+ const { width } = yield input.boundingBox();
291
+ (0, fixtures_1.expect)(width).toBe(200);
292
+ }));
293
+ (0, fixtures_1.test)("input with label has correct width in px", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
294
+ yield initTestBed(`<ColorPicker width="200px" label="test" testId="test"/>`, {});
295
+ const input = page.getByTestId("test");
296
+ const { width } = yield input.boundingBox();
297
+ (0, fixtures_1.expect)(width).toBe(200);
298
+ }));
299
+ (0, fixtures_1.test)("input has correct width in %", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
300
+ yield page.setViewportSize({ width: 400, height: 300 });
301
+ yield initTestBed(`<ColorPicker width="50%" testId="test"/>`, {});
302
+ const input = page.getByTestId("test");
303
+ const { width } = yield input.boundingBox();
304
+ (0, fixtures_1.expect)(width).toBe(200);
305
+ }));
306
+ (0, fixtures_1.test)("input with label has correct width in %", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
307
+ yield page.setViewportSize({ width: 400, height: 300 });
308
+ yield initTestBed(`<ColorPicker width="50%" label="test" testId="test"/>`, {});
309
+ const input = page.getByTestId("test");
310
+ const { width } = yield input.boundingBox();
311
+ (0, fixtures_1.expect)(width).toBe(200);
312
+ }));
@@ -18,11 +18,12 @@ exports.ColorPicker = exports.defaultProps = void 0;
18
18
  const jsx_runtime_1 = require("react/jsx-runtime");
19
19
  const react_1 = require("react");
20
20
  const react_2 = require("react");
21
- const ItemWithLabel_1 = require("../FormItem/ItemWithLabel");
22
21
  const constants_1 = require("../../components-core/constants");
23
22
  const misc_1 = require("../../components-core/utils/misc");
24
23
  const ColorPicker_module_scss_1 = __importDefault(require("./ColorPicker.module.scss"));
25
24
  const classnames_1 = __importDefault(require("classnames"));
25
+ const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
26
+ const parts_1 = require("../../components-core/parts");
26
27
  exports.defaultProps = {
27
28
  initialValue: "#000000",
28
29
  value: "#000000",
@@ -30,9 +31,10 @@ exports.defaultProps = {
30
31
  validationStatus: "none",
31
32
  };
32
33
  exports.ColorPicker = (0, react_2.forwardRef)((_a, forwardedRef) => {
33
- var { style, className, updateState, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, enabled = exports.defaultProps.enabled, readOnly, value = exports.defaultProps.value, autoFocus, tabIndex = 0, label, labelPosition, labelWidth, labelBreak, required, validationStatus = exports.defaultProps.validationStatus, initialValue = exports.defaultProps.initialValue } = _a, rest = __rest(_a, ["style", "className", "updateState", "onDidChange", "onFocus", "onBlur", "registerComponentApi", "enabled", "readOnly", "value", "autoFocus", "tabIndex", "label", "labelPosition", "labelWidth", "labelBreak", "required", "validationStatus", "initialValue"]);
34
- const inputRef = (0, react_2.useRef)(null);
34
+ var { id, style, className, updateState, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, registerComponentApi, enabled = exports.defaultProps.enabled, readOnly, value = exports.defaultProps.value, autoFocus, tabIndex = 0, required, validationStatus = exports.defaultProps.validationStatus, initialValue = exports.defaultProps.initialValue } = _a, rest = __rest(_a, ["id", "style", "className", "updateState", "onDidChange", "onFocus", "onBlur", "registerComponentApi", "enabled", "readOnly", "value", "autoFocus", "tabIndex", "required", "validationStatus", "initialValue"]);
35
35
  const [isPending, startTransition] = (0, react_1.useTransition)();
36
+ const inputRef = (0, react_2.useRef)(null);
37
+ const composedRef = forwardedRef ? (0, react_compose_refs_1.composeRefs)(forwardedRef, inputRef) : inputRef;
36
38
  const updateValue = (0, react_2.useCallback)((value) => {
37
39
  updateState({ value });
38
40
  onDidChange(value);
@@ -73,11 +75,12 @@ exports.ColorPicker = (0, react_2.forwardRef)((_a, forwardedRef) => {
73
75
  setValue,
74
76
  });
75
77
  }, [focus, registerComponentApi, setValue]);
76
- return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, Object.assign({}, rest, { labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, className: className, ref: forwardedRef, children: (0, jsx_runtime_1.jsx)("input", { className: (0, classnames_1.default)(ColorPicker_module_scss_1.default.colorInput, {
77
- [ColorPicker_module_scss_1.default.disabled]: !enabled,
78
- [ColorPicker_module_scss_1.default.error]: validationStatus === "error",
79
- [ColorPicker_module_scss_1.default.warning]: validationStatus === "warning",
80
- [ColorPicker_module_scss_1.default.valid]: validationStatus === "valid",
81
- }), disabled: !enabled, onFocus: handleOnFocus, onChange: onInputChange, readOnly: readOnly, autoFocus: autoFocus, tabIndex: tabIndex, onBlur: handleOnBlur, required: required, type: "color", inputMode: "text", ref: inputRef, value: value }) })));
78
+ { /* Produces a 7 character RGB color output in hex as a string type */ }
79
+ return ((0, jsx_runtime_1.jsx)("input", Object.assign({}, rest, { id: id, className: (0, classnames_1.default)(className, ColorPicker_module_scss_1.default.colorInput, {
80
+ [ColorPicker_module_scss_1.default.disabled]: !enabled,
81
+ [ColorPicker_module_scss_1.default.error]: validationStatus === "error",
82
+ [ColorPicker_module_scss_1.default.warning]: validationStatus === "warning",
83
+ [ColorPicker_module_scss_1.default.valid]: validationStatus === "valid",
84
+ }), "data-part-id": parts_1.PART_INPUT, style: style, disabled: !enabled, onFocus: handleOnFocus, onChange: onInputChange, readOnly: readOnly, autoFocus: autoFocus, tabIndex: tabIndex, onBlur: handleOnBlur, required: required, type: "color", inputMode: "text", ref: composedRef, value: value })));
82
85
  });
83
86
  exports.ColorPicker.displayName = "ColorPicker";
@@ -53,6 +53,7 @@ const Footer_1 = require("./Footer/Footer");
53
53
  const NavGroup_1 = require("./NavGroup/NavGroup");
54
54
  const Logo_1 = require("./Logo/Logo");
55
55
  const RadioGroup_1 = require("./RadioGroup/RadioGroup");
56
+ const RadioItem_1 = require("./RadioGroup/RadioItem");
56
57
  const Slot_1 = require("./Slot/Slot");
57
58
  const FileInput_1 = require("./FileInput/FileInput");
58
59
  const Spinner_1 = require("./Spinner/Spinner");
@@ -412,6 +413,7 @@ class ComponentRegistry {
412
413
  this.registerCoreComponent(NumberBox_1.numberBoxComponentRenderer);
413
414
  this.registerCoreComponent(HoverCard_1.hoverCardComponentRenderer);
414
415
  this.registerCoreComponent(RadioGroup_1.radioGroupRenderer);
416
+ this.registerCoreComponent(RadioItem_1.radioItemComponentRenderer);
415
417
  this.registerCoreComponent(FileInput_1.fileInputRenderer);
416
418
  this.registerCoreComponent(Spinner_1.spinnerComponentRenderer);
417
419
  this.registerCoreComponent(Select_1.selectComponentRenderer);
@@ -36,10 +36,6 @@ exports.DateInputMd = (0, metadata_helpers_1.createMetadata)({
36
36
  readOnly: (0, metadata_helpers_1.dReadonly)(),
37
37
  enabled: (0, metadata_helpers_1.dEnabled)(DateInputNative_1.defaultProps.enabled),
38
38
  validationStatus: (0, metadata_helpers_1.dValidationStatus)(DateInputNative_1.defaultProps.validationStatus),
39
- label: (0, metadata_helpers_1.dLabel)(),
40
- labelPosition: (0, metadata_helpers_1.dLabelPosition)("top"),
41
- labelWidth: (0, metadata_helpers_1.dLabelWidth)(COMP),
42
- labelBreak: (0, metadata_helpers_1.dLabelBreak)(COMP),
43
39
  mode: {
44
40
  description: "The mode of the date input (single or range)",
45
41
  valueType: "string",
@@ -197,5 +193,5 @@ exports.DateInputMd = (0, metadata_helpers_1.createMetadata)({
197
193
  });
198
194
  exports.dateInputComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.DateInputMd, ({ node, state, updateState, extractValue, className, lookupEventHandler, registerComponentApi, }) => {
199
195
  var _a;
200
- return ((0, jsx_runtime_1.jsx)(DateInputNative_1.DateInput, { id: node.uid, className: className, mode: extractValue((_a = node.props) === null || _a === void 0 ? void 0 : _a.mode), value: state === null || state === void 0 ? void 0 : state.value, initialValue: extractValue(node.props.initialValue), enabled: extractValue.asOptionalBoolean(node.props.enabled), validationStatus: extractValue(node.props.validationStatus), updateState: updateState, onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), registerComponentApi: registerComponentApi, dateFormat: extractValue(node.props.dateFormat), showWeekNumber: extractValue.asOptionalBoolean(node.props.showWeekNumber), weekStartsOn: extractValue.asOptionalNumber(node.props.weekStartsOn), minValue: extractValue.asOptionalString(node.props.minValue), maxValue: extractValue.asOptionalString(node.props.maxValue), disabledDates: extractValue(node.props.disabledDates), inline: extractValue.asOptionalBoolean(node.props.inline, DateInputNative_1.defaultProps.inline), startText: extractValue.asOptionalString(node.props.startText), startIcon: extractValue.asOptionalString(node.props.startIcon), endText: extractValue.asOptionalString(node.props.endText), endIcon: extractValue.asOptionalString(node.props.endIcon), label: extractValue.asOptionalString(node.props.label), labelPosition: extractValue.asOptionalString(node.props.labelPosition), labelWidth: extractValue.asOptionalString(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), readOnly: extractValue.asOptionalBoolean(node.props.readOnly), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), required: extractValue.asOptionalBoolean(node.props.required), clearable: extractValue.asOptionalBoolean(node.props.clearable, DateInputNative_1.defaultProps.clearable), clearIcon: extractValue.asOptionalString(node.props.clearIcon), clearToInitialValue: extractValue.asOptionalBoolean(node.props.clearToInitialValue, DateInputNative_1.defaultProps.clearToInitialValue), gap: extractValue.asOptionalString(node.props.gap), emptyCharacter: extractValue.asOptionalString(node.props.emptyCharacter) }));
196
+ return ((0, jsx_runtime_1.jsx)(DateInputNative_1.DateInput, { id: node.uid, className: className, mode: extractValue((_a = node.props) === null || _a === void 0 ? void 0 : _a.mode), value: state === null || state === void 0 ? void 0 : state.value, initialValue: extractValue(node.props.initialValue), enabled: extractValue.asOptionalBoolean(node.props.enabled), validationStatus: extractValue(node.props.validationStatus), updateState: updateState, onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), registerComponentApi: registerComponentApi, dateFormat: extractValue(node.props.dateFormat), showWeekNumber: extractValue.asOptionalBoolean(node.props.showWeekNumber), weekStartsOn: extractValue.asOptionalNumber(node.props.weekStartsOn), minValue: extractValue.asOptionalString(node.props.minValue), maxValue: extractValue.asOptionalString(node.props.maxValue), disabledDates: extractValue(node.props.disabledDates), inline: extractValue.asOptionalBoolean(node.props.inline, DateInputNative_1.defaultProps.inline), startText: extractValue.asOptionalString(node.props.startText), startIcon: extractValue.asOptionalString(node.props.startIcon), endText: extractValue.asOptionalString(node.props.endText), endIcon: extractValue.asOptionalString(node.props.endIcon), readOnly: extractValue.asOptionalBoolean(node.props.readOnly), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), required: extractValue.asOptionalBoolean(node.props.required), clearable: extractValue.asOptionalBoolean(node.props.clearable, DateInputNative_1.defaultProps.clearable), clearIcon: extractValue.asOptionalString(node.props.clearIcon), clearToInitialValue: extractValue.asOptionalBoolean(node.props.clearToInitialValue, DateInputNative_1.defaultProps.clearToInitialValue), gap: extractValue.asOptionalString(node.props.gap), emptyCharacter: extractValue.asOptionalString(node.props.emptyCharacter) }));
201
197
  });