From 838769a8b9347e34e83abf898551497fbefca396 Mon Sep 17 00:00:00 2001 From: Zack Braksa Date: Thu, 25 Jul 2024 01:29:18 +0100 Subject: [PATCH 01/12] Add BasicEntityAutocompleteField component --- dist/BasicEntityAutocompleteField.d.ts | 2 + dist/BasicEntityCheckBoxField.d.ts | 2 + dist/BasicEntityRadioGroupField.d.ts | 2 + dist/voxgig-model-react.es.js | 239 ++++++++--------------- dist/voxgig-model-react.umd.js | 237 ++++++++-------------- src/lib/BasicEntityAutocompleteField.tsx | 44 +++++ src/lib/BasicEntityEdit.tsx | 2 + src/lib/BasicEntityField.tsx | 2 + 8 files changed, 219 insertions(+), 311 deletions(-) create mode 100644 dist/BasicEntityAutocompleteField.d.ts create mode 100644 dist/BasicEntityCheckBoxField.d.ts create mode 100644 dist/BasicEntityRadioGroupField.d.ts create mode 100644 src/lib/BasicEntityAutocompleteField.tsx diff --git a/dist/BasicEntityAutocompleteField.d.ts b/dist/BasicEntityAutocompleteField.d.ts new file mode 100644 index 0000000..cf25015 --- /dev/null +++ b/dist/BasicEntityAutocompleteField.d.ts @@ -0,0 +1,2 @@ +declare function BasicEntityAutocompleteField(props: any): import("react/jsx-runtime").JSX.Element; +export { BasicEntityAutocompleteField }; diff --git a/dist/BasicEntityCheckBoxField.d.ts b/dist/BasicEntityCheckBoxField.d.ts new file mode 100644 index 0000000..3a9d2ea --- /dev/null +++ b/dist/BasicEntityCheckBoxField.d.ts @@ -0,0 +1,2 @@ +declare function BasicEntityCheckBoxField(props: any): import("react/jsx-runtime").JSX.Element; +export { BasicEntityCheckBoxField }; diff --git a/dist/BasicEntityRadioGroupField.d.ts b/dist/BasicEntityRadioGroupField.d.ts new file mode 100644 index 0000000..3219868 --- /dev/null +++ b/dist/BasicEntityRadioGroupField.d.ts @@ -0,0 +1,2 @@ +declare function BasicEntityRadioGroupField(props: any): import("react/jsx-runtime").JSX.Element; +export { BasicEntityRadioGroupField }; diff --git a/dist/voxgig-model-react.es.js b/dist/voxgig-model-react.es.js index 92e9a18..8170af1 100644 --- a/dist/voxgig-model-react.es.js +++ b/dist/voxgig-model-react.es.js @@ -54,7 +54,7 @@ var __async = (__this, __arguments, generator) => { }; import * as React$1 from "react"; import React__default, { isValidElement, Children, cloneElement, useMemo, useState, useReducer, useRef, useEffect, useCallback, memo as memo$2, Fragment, useLayoutEffect } from "react"; -import { Button as Button$1, Avatar, Menu as Menu$1, MenuItem as MenuItem$1, IconButton as IconButton$1, useTheme as useTheme$5, Box as Box$2, TextField as TextField$1, Grid as Grid$1, Toolbar as Toolbar$1, Container as Container$2, Drawer as Drawer$1, List as List$1, ListItem as ListItem$1, ListItemButton as ListItemButton$1, ListItemIcon as ListItemIcon$1, ListItemText as ListItemText$1, Divider as Divider$1, Typography as Typography$1 } from "@mui/material"; +import { Button as Button$1, Avatar, Menu as Menu$1, MenuItem as MenuItem$1, IconButton as IconButton$1, useTheme as useTheme$5, Box as Box$2, Autocomplete as Autocomplete$1, TextField as TextField$1, Grid as Grid$1, Toolbar as Toolbar$1, Container as Container$2, Drawer as Drawer$1, List as List$1, ListItem as ListItem$1, ListItemButton as ListItemButton$1, ListItemIcon as ListItemIcon$1, ListItemText as ListItemText$1, Divider as Divider$1, Typography as Typography$1 } from "@mui/material"; import emStyled from "@emotion/styled"; import { CacheProvider, Global, ThemeContext as ThemeContext$1, css, keyframes } from "@emotion/react"; import { useSelector } from "react-redux"; @@ -2854,6 +2854,7 @@ function requireObjectWithoutPropertiesLoose() { })(objectWithoutPropertiesLoose$1); return objectWithoutPropertiesLoose$1.exports; } +var isDevelopment = false; function sheetForTag(tag) { if (tag.sheet) { return tag.sheet; @@ -2863,6 +2864,7 @@ function sheetForTag(tag) { return document.styleSheets[i]; } } + return void 0; } function createStyleElement(options) { var tag = document.createElement("style"); @@ -2893,7 +2895,7 @@ var StyleSheet = /* @__PURE__ */ function() { _this.container.insertBefore(tag, before); _this.tags.push(tag); }; - this.isSpeedy = options.speedy === void 0 ? process.env.NODE_ENV === "production" : options.speedy; + this.isSpeedy = options.speedy === void 0 ? !isDevelopment : options.speedy; this.tags = []; this.ctr = 0; this.nonce = options.nonce; @@ -2912,21 +2914,11 @@ var StyleSheet = /* @__PURE__ */ function() { this._insertTag(createStyleElement(this)); } var tag = this.tags[this.tags.length - 1]; - if (process.env.NODE_ENV !== "production") { - var isImportRule3 = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105; - if (isImportRule3 && this._alreadyInsertedOrderInsensitiveRule) { - console.error("You're attempting to insert the following rule:\n" + rule + "\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules."); - } - this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule3; - } if (this.isSpeedy) { var sheet = sheetForTag(tag); try { sheet.insertRule(rule, sheet.cssRules.length); } catch (e) { - if (process.env.NODE_ENV !== "production" && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) { - console.error('There was a problem inserting the following rule: "' + rule + '"', e); - } } } else { tag.appendChild(document.createTextNode(rule)); @@ -2935,13 +2927,11 @@ var StyleSheet = /* @__PURE__ */ function() { }; _proto.flush = function flush() { this.tags.forEach(function(tag) { - return tag.parentNode && tag.parentNode.removeChild(tag); + var _tag$parentNode; + return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag); }); this.tags = []; this.ctr = 0; - if (process.env.NODE_ENV !== "production") { - this._alreadyInsertedOrderInsensitiveRule = false; - } }; return StyleSheet2; }(); @@ -3626,68 +3616,6 @@ var removeLabel = function removeLabel2(element) { } } }; -var ignoreFlag = "emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason"; -var isIgnoringComment = function isIgnoringComment2(element) { - return element.type === "comm" && element.children.indexOf(ignoreFlag) > -1; -}; -var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm2(cache2) { - return function(element, index2, children2) { - if (element.type !== "rule" || cache2.compat) return; - var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g); - if (unsafePseudoClasses) { - var isNested = !!element.parent; - var commentContainer = isNested ? element.parent.children : ( - // global rule at the root level - children2 - ); - for (var i = commentContainer.length - 1; i >= 0; i--) { - var node2 = commentContainer[i]; - if (node2.line < element.line) { - break; - } - if (node2.column < element.column) { - if (isIgnoringComment(node2)) { - return; - } - break; - } - } - unsafePseudoClasses.forEach(function(unsafePseudoClass) { - console.error('The pseudo class "' + unsafePseudoClass + '" is potentially unsafe when doing server-side rendering. Try changing it to "' + unsafePseudoClass.split("-child")[0] + '-of-type".'); - }); - } - }; -}; -var isImportRule = function isImportRule2(element) { - return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64; -}; -var isPrependedWithRegularRules = function isPrependedWithRegularRules2(index2, children2) { - for (var i = index2 - 1; i >= 0; i--) { - if (!isImportRule(children2[i])) { - return true; - } - } - return false; -}; -var nullifyElement = function nullifyElement2(element) { - element.type = ""; - element.value = ""; - element["return"] = ""; - element.children = ""; - element.props = ""; -}; -var incorrectImportAlarm = function incorrectImportAlarm2(element, index2, children2) { - if (!isImportRule(element)) { - return; - } - if (element.parent) { - console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."); - nullifyElement(element); - } else if (isPrependedWithRegularRules(index2, children2)) { - console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."); - nullifyElement(element); - } -}; function prefix(value, length2) { switch (hash$2(value, length2)) { case 5103: @@ -3834,9 +3762,6 @@ var prefixer = function prefixer2(element, index2, children2, callback) { var defaultStylisPlugins = [prefixer]; var createCache = function createCache2(options) { var key = options.key; - if (process.env.NODE_ENV !== "production" && !key) { - throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\nIf multiple caches share the same key they might \"fight\" for each other's style elements."); - } if (key === "css") { var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); Array.prototype.forEach.call(ssrStyles, function(node2) { @@ -3849,11 +3774,6 @@ var createCache = function createCache2(options) { }); } var stylisPlugins = options.stylisPlugins || defaultStylisPlugins; - if (process.env.NODE_ENV !== "production") { - if (/[^a-z-]/.test(key)) { - throw new Error('Emotion key must only contain lower case alphabetical characters and - but "' + key + '" was passed'); - } - } var inserted = {}; var container; var nodesToHydrate = []; @@ -3874,24 +3794,9 @@ var createCache = function createCache2(options) { } var _insert; var omnipresentPlugins = [compat, removeLabel]; - if (process.env.NODE_ENV !== "production") { - omnipresentPlugins.push(createUnsafeSelectorsAlarm({ - get compat() { - return cache2.compat; - } - }), incorrectImportAlarm); - } { var currentSheet; - var finalizingPlugins = [stringify, process.env.NODE_ENV !== "production" ? function(element) { - if (!element.root) { - if (element["return"]) { - currentSheet.insert(element["return"]); - } else if (element.value && element.type !== COMMENT) { - currentSheet.insert(element.value + "{}"); - } - } - } : rulesheet(function(rule) { + var finalizingPlugins = [stringify, rulesheet(function(rule) { currentSheet.insert(rule); })]; var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins)); @@ -3900,13 +3805,6 @@ var createCache = function createCache2(options) { }; _insert = function insert2(selector, serialized, sheet, shouldCache) { currentSheet = sheet; - if (process.env.NODE_ENV !== "production" && serialized.map !== void 0) { - currentSheet = { - insert: function insert3(rule) { - sheet.insert(rule + serialized.map); - } - }; - } stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles); if (shouldCache) { cache2.inserted[serialized.name] = true; @@ -39125,7 +39023,7 @@ const PickersLayoutContentWrapper = styled$1("div", { display: "flex", flexDirection: "column" }); -const PickersLayout = function PickersLayout2(inProps) { +const PickersLayout = /* @__PURE__ */ React$1.forwardRef(function PickersLayout2(inProps, ref) { const props = useThemeProps({ props: inProps, name: "MuiPickersLayout" @@ -39141,7 +39039,6 @@ const PickersLayout = function PickersLayout2(inProps) { sx, className, isLandscape, - ref, wrapperVariant } = props; const classes = useUtilityClasses$J(props); @@ -39159,7 +39056,7 @@ const PickersLayout = function PickersLayout2(inProps) { }) }), actionBar] }); -}; +}); process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | @@ -45063,7 +44960,7 @@ const pickersCalendarHeaderClasses = generateUtilityClasses("MuiPickersCalendarH function getPickersArrowSwitcherUtilityClass(slot) { return generateUtilityClass("MuiPickersArrowSwitcher", slot); } -const pickersArrowSwitcherClasses = generateUtilityClasses("MuiPickersArrowSwitcher", ["root", "spacer", "button"]); +const pickersArrowSwitcherClasses = generateUtilityClasses("MuiPickersArrowSwitcher", ["root", "spacer", "button", "previousIconButton", "nextIconButton", "leftArrowIcon", "rightArrowIcon"]); const _excluded$E = ["children", "className", "slots", "slotProps", "isNextDisabled", "isNextHidden", "onGoToNext", "nextLabel", "isPreviousDisabled", "isPreviousHidden", "onGoToPrevious", "previousLabel", "labelId"], _excluded2$3 = ["ownerState"], _excluded3$1 = ["ownerState"]; const PickersArrowSwitcherRoot = styled$1("div", { name: "MuiPickersArrowSwitcher", @@ -45102,7 +44999,11 @@ const useUtilityClasses$u = (ownerState) => { const slots = { root: ["root"], spacer: ["spacer"], - button: ["button"] + button: ["button"], + previousIconButton: ["previousIconButton"], + nextIconButton: ["nextIconButton"], + leftArrowIcon: ["leftArrowIcon"], + rightArrowIcon: ["rightArrowIcon"] }; return composeClasses(slots, getPickersArrowSwitcherUtilityClass, classes); }; @@ -45157,7 +45058,7 @@ const PickersArrowSwitcher = /* @__PURE__ */ React$1.forwardRef(function Pickers ownerState: _extends$1({}, ownerState, { hidden: previousProps.isHidden }), - className: classes.button + className: clsx(classes.button, classes.previousIconButton) }); const NextIconButton = (_b = slots == null ? void 0 : slots.nextIconButton) != null ? _b : PickersArrowSwitcherButton; const nextIconButtonProps = useSlotProps({ @@ -45174,7 +45075,7 @@ const PickersArrowSwitcher = /* @__PURE__ */ React$1.forwardRef(function Pickers ownerState: _extends$1({}, ownerState, { hidden: nextProps.isHidden }), - className: classes.button + className: clsx(classes.button, classes.nextIconButton) }); const LeftArrowIcon = (_c = slots == null ? void 0 : slots.leftArrowIcon) != null ? _c : ArrowLeftIcon; const _useSlotProps = useSlotProps({ @@ -45183,7 +45084,8 @@ const PickersArrowSwitcher = /* @__PURE__ */ React$1.forwardRef(function Pickers additionalProps: { fontSize: "inherit" }, - ownerState: void 0 + ownerState, + className: classes.leftArrowIcon }), leftArrowIconProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2$3); const RightArrowIcon = (_d = slots == null ? void 0 : slots.rightArrowIcon) != null ? _d : ArrowRightIcon; const _useSlotProps2 = useSlotProps({ @@ -45192,7 +45094,8 @@ const PickersArrowSwitcher = /* @__PURE__ */ React$1.forwardRef(function Pickers additionalProps: { fontSize: "inherit" }, - ownerState: void 0 + ownerState, + className: classes.rightArrowIcon }), rightArrowIconProps = _objectWithoutPropertiesLoose(_useSlotProps2, _excluded3$1); return /* @__PURE__ */ jsxRuntimeExports.jsxs(PickersArrowSwitcherRoot, _extends$1({ ref, @@ -45373,7 +45276,7 @@ const PickersCalendarHeader = /* @__PURE__ */ React$1.forwardRef(function Picker const _useSlotProps = useSlotProps({ elementType: SwitchViewIcon, externalSlotProps: slotProps == null ? void 0 : slotProps.switchViewIcon, - ownerState: void 0, + ownerState, className: classes.switchViewIcon }), switchViewIconProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2$2); const selectNextMonth = () => onMonthChange(utils2.addMonths(month, 1), "left"); @@ -50303,10 +50206,11 @@ function ClockPointer(inProps) { function getClockUtilityClass(slot) { return generateUtilityClass("MuiClock", slot); } -const clockClasses = generateUtilityClasses("MuiClock", ["root", "clock", "wrapper", "squareMask", "pin", "amButton", "pmButton", "meridiemText"]); +const clockClasses = generateUtilityClasses("MuiClock", ["root", "clock", "wrapper", "squareMask", "pin", "amButton", "pmButton", "meridiemText", "selected"]); const useUtilityClasses$h = (ownerState) => { const { - classes + classes, + meridiemMode } = ownerState; const slots = { root: ["root"], @@ -50314,8 +50218,8 @@ const useUtilityClasses$h = (ownerState) => { wrapper: ["wrapper"], squareMask: ["squareMask"], pin: ["pin"], - amButton: ["amButton"], - pmButton: ["pmButton"], + amButton: ["amButton", meridiemMode === "am" && "selected"], + pmButton: ["pmButton", meridiemMode === "pm" && "selected"], meridiemText: ["meridiemText"] }; return composeClasses(slots, getClockUtilityClass, classes); @@ -50398,23 +50302,15 @@ const ClockPin = styled$1("div", { left: "50%", transform: "translate(-50%, -50%)" })); -const ClockAmButton = styled$1(IconButton, { - name: "MuiClock", - slot: "AmButton", - overridesResolver: (_2, styles2) => styles2.amButton -})(({ - theme -}) => ({ +const meridiemButtonCommonStyles = (theme, meridiemMode) => ({ zIndex: 1, - position: "absolute", bottom: 8, - left: 8, paddingLeft: 4, paddingRight: 4, width: CLOCK_HOUR_WIDTH, variants: [{ props: { - meridiemMode: "am" + meridiemMode }, style: { backgroundColor: (theme.vars || theme).palette.primary.main, @@ -50424,6 +50320,17 @@ const ClockAmButton = styled$1(IconButton, { } } }] +}); +const ClockAmButton = styled$1(IconButton, { + name: "MuiClock", + slot: "AmButton", + overridesResolver: (_2, styles2) => styles2.amButton +})(({ + theme +}) => _extends$1({}, meridiemButtonCommonStyles(theme, "am"), { + // keeping it here to make TS happy + position: "absolute", + left: 8 })); const ClockPmButton = styled$1(IconButton, { name: "MuiClock", @@ -50431,26 +50338,10 @@ const ClockPmButton = styled$1(IconButton, { overridesResolver: (_2, styles2) => styles2.pmButton })(({ theme -}) => ({ - zIndex: 1, +}) => _extends$1({}, meridiemButtonCommonStyles(theme, "pm"), { + // keeping it here to make TS happy position: "absolute", - bottom: 8, - right: 8, - paddingLeft: 4, - paddingRight: 4, - width: CLOCK_HOUR_WIDTH, - variants: [{ - props: { - meridiemMode: "pm" - }, - style: { - backgroundColor: (theme.vars || theme).palette.primary.main, - color: (theme.vars || theme).palette.primary.contrastText, - "&:hover": { - backgroundColor: (theme.vars || theme).palette.primary.light - } - } - }] + right: 8 })); const ClockMeridiemText = styled$1(Typography, { name: "MuiClock", @@ -52517,7 +52408,7 @@ const renderMultiSectionDigitalClockTimeView = ({ skipDisabled, timezone }); -function DesktopDateTimePickerLayout(props) { +const DesktopDateTimePickerLayout = /* @__PURE__ */ React$1.forwardRef(function DesktopDateTimePickerLayout2(props, ref) { var _a, _b; const isRtl = useRtl(); const { @@ -52531,7 +52422,6 @@ function DesktopDateTimePickerLayout(props) { sx, className, isLandscape, - ref, classes } = props; const isActionBarVisible = actionBar && ((_b = (_a = actionBar.props.actions) == null ? void 0 : _a.length) != null ? _b : 0) > 0; @@ -52564,7 +52454,7 @@ function DesktopDateTimePickerLayout(props) { })] }), actionBar] }); -} +}); process.env.NODE_ENV !== "production" ? DesktopDateTimePickerLayout.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | @@ -64782,6 +64672,40 @@ function useForm(props = {}) { _formControl.current.formState = getProxyFormState(formState, control); return _formControl.current; } +function BasicEntityAutocompleteField(props) { + const { spec } = props; + const { field, getValues, control } = spec; + const val = getValues(field.name); + return /* @__PURE__ */ jsxRuntimeExports.jsx( + Controller, + { + name: field.name, + control, + defaultValue: resolveOptions(field.options.default), + render: ({ field: { onChange, value } }) => /* @__PURE__ */ jsxRuntimeExports.jsx( + Autocomplete$1, + { + freeSolo: true, + forcePopupIcon: true, + multiple: field.ux.multiple, + options: resolveOptions(field.options.ents), + isOptionEqualToValue: (option, value2) => option.value === value2.value, + getOptionLabel: (option) => option.label, + value, + onChange: (e, val2) => onChange(val2), + renderInput: (params) => /* @__PURE__ */ jsxRuntimeExports.jsx(TextField$1, __spreadProps(__spreadValues({}, params), { label: field.label })) + }, + field.id + ) + } + ); +} +function resolveOptions(options) { + return Object.keys(options).map((key) => ({ + label: options[key].label, + value: key + })); +} const CMPNAME$8 = "BasicEntityField"; const { Open: Open$6 } = gubu_minExports.Gubu; const BasicEntityFieldSpecShape = gubu_minExports.Gubu(Open$6({}), { name: CMPNAME$8 }); @@ -64790,7 +64714,8 @@ const fieldMap = { TextBox: BasicEntityTextBoxField, Date: BasicEntityDateField, DateTime: BasicEntityDateTimeField, - Time: BasicEntityTimeField + Time: BasicEntityTimeField, + Autocomplete: BasicEntityAutocompleteField }; function BasicEntityField(props) { const { ctx, spec } = props; @@ -65001,6 +64926,7 @@ function BasicEntityEdit(props) { handleSubmit, getValues, reset, + control, formState: { errors } } = useForm({ mode: "onChange", @@ -65029,6 +64955,7 @@ function BasicEntityEdit(props) { field, register, getValues, + control, errors } } diff --git a/dist/voxgig-model-react.umd.js b/dist/voxgig-model-react.umd.js index bce3f35..4b5d9b2 100644 --- a/dist/voxgig-model-react.umd.js +++ b/dist/voxgig-model-react.umd.js @@ -2866,6 +2866,7 @@ var __async = (__this, __arguments, generator) => { })(objectWithoutPropertiesLoose$1); return objectWithoutPropertiesLoose$1.exports; } + var isDevelopment = false; function sheetForTag(tag) { if (tag.sheet) { return tag.sheet; @@ -2875,6 +2876,7 @@ var __async = (__this, __arguments, generator) => { return document.styleSheets[i]; } } + return void 0; } function createStyleElement(options) { var tag = document.createElement("style"); @@ -2905,7 +2907,7 @@ var __async = (__this, __arguments, generator) => { _this.container.insertBefore(tag, before); _this.tags.push(tag); }; - this.isSpeedy = options.speedy === void 0 ? process.env.NODE_ENV === "production" : options.speedy; + this.isSpeedy = options.speedy === void 0 ? !isDevelopment : options.speedy; this.tags = []; this.ctr = 0; this.nonce = options.nonce; @@ -2924,21 +2926,11 @@ var __async = (__this, __arguments, generator) => { this._insertTag(createStyleElement(this)); } var tag = this.tags[this.tags.length - 1]; - if (process.env.NODE_ENV !== "production") { - var isImportRule2 = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105; - if (isImportRule2 && this._alreadyInsertedOrderInsensitiveRule) { - console.error("You're attempting to insert the following rule:\n" + rule + "\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules."); - } - this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule2; - } if (this.isSpeedy) { var sheet = sheetForTag(tag); try { sheet.insertRule(rule, sheet.cssRules.length); } catch (e) { - if (process.env.NODE_ENV !== "production" && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) { - console.error('There was a problem inserting the following rule: "' + rule + '"', e); - } } } else { tag.appendChild(document.createTextNode(rule)); @@ -2947,13 +2939,11 @@ var __async = (__this, __arguments, generator) => { }; _proto.flush = function flush() { this.tags.forEach(function(tag) { - return tag.parentNode && tag.parentNode.removeChild(tag); + var _tag$parentNode; + return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag); }); this.tags = []; this.ctr = 0; - if (process.env.NODE_ENV !== "production") { - this._alreadyInsertedOrderInsensitiveRule = false; - } }; return StyleSheet2; }(); @@ -3638,68 +3628,6 @@ var __async = (__this, __arguments, generator) => { } } }; - var ignoreFlag = "emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason"; - var isIgnoringComment = function isIgnoringComment2(element) { - return element.type === "comm" && element.children.indexOf(ignoreFlag) > -1; - }; - var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm2(cache2) { - return function(element, index2, children) { - if (element.type !== "rule" || cache2.compat) return; - var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g); - if (unsafePseudoClasses) { - var isNested = !!element.parent; - var commentContainer = isNested ? element.parent.children : ( - // global rule at the root level - children - ); - for (var i = commentContainer.length - 1; i >= 0; i--) { - var node2 = commentContainer[i]; - if (node2.line < element.line) { - break; - } - if (node2.column < element.column) { - if (isIgnoringComment(node2)) { - return; - } - break; - } - } - unsafePseudoClasses.forEach(function(unsafePseudoClass) { - console.error('The pseudo class "' + unsafePseudoClass + '" is potentially unsafe when doing server-side rendering. Try changing it to "' + unsafePseudoClass.split("-child")[0] + '-of-type".'); - }); - } - }; - }; - var isImportRule = function isImportRule2(element) { - return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64; - }; - var isPrependedWithRegularRules = function isPrependedWithRegularRules2(index2, children) { - for (var i = index2 - 1; i >= 0; i--) { - if (!isImportRule(children[i])) { - return true; - } - } - return false; - }; - var nullifyElement = function nullifyElement2(element) { - element.type = ""; - element.value = ""; - element["return"] = ""; - element.children = ""; - element.props = ""; - }; - var incorrectImportAlarm = function incorrectImportAlarm2(element, index2, children) { - if (!isImportRule(element)) { - return; - } - if (element.parent) { - console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."); - nullifyElement(element); - } else if (isPrependedWithRegularRules(index2, children)) { - console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."); - nullifyElement(element); - } - }; function prefix(value, length2) { switch (hash$2(value, length2)) { case 5103: @@ -3846,9 +3774,6 @@ var __async = (__this, __arguments, generator) => { var defaultStylisPlugins = [prefixer]; var createCache = function createCache2(options) { var key = options.key; - if (process.env.NODE_ENV !== "production" && !key) { - throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\nIf multiple caches share the same key they might \"fight\" for each other's style elements."); - } if (key === "css") { var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); Array.prototype.forEach.call(ssrStyles, function(node2) { @@ -3861,11 +3786,6 @@ var __async = (__this, __arguments, generator) => { }); } var stylisPlugins = options.stylisPlugins || defaultStylisPlugins; - if (process.env.NODE_ENV !== "production") { - if (/[^a-z-]/.test(key)) { - throw new Error('Emotion key must only contain lower case alphabetical characters and - but "' + key + '" was passed'); - } - } var inserted = {}; var container; var nodesToHydrate = []; @@ -3886,24 +3806,9 @@ var __async = (__this, __arguments, generator) => { } var _insert; var omnipresentPlugins = [compat, removeLabel]; - if (process.env.NODE_ENV !== "production") { - omnipresentPlugins.push(createUnsafeSelectorsAlarm({ - get compat() { - return cache2.compat; - } - }), incorrectImportAlarm); - } { var currentSheet; - var finalizingPlugins = [stringify, process.env.NODE_ENV !== "production" ? function(element) { - if (!element.root) { - if (element["return"]) { - currentSheet.insert(element["return"]); - } else if (element.value && element.type !== COMMENT) { - currentSheet.insert(element.value + "{}"); - } - } - } : rulesheet(function(rule) { + var finalizingPlugins = [stringify, rulesheet(function(rule) { currentSheet.insert(rule); })]; var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins)); @@ -3912,13 +3817,6 @@ var __async = (__this, __arguments, generator) => { }; _insert = function insert2(selector, serialized, sheet, shouldCache) { currentSheet = sheet; - if (process.env.NODE_ENV !== "production" && serialized.map !== void 0) { - currentSheet = { - insert: function insert3(rule) { - sheet.insert(rule + serialized.map); - } - }; - } stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles); if (shouldCache) { cache2.inserted[serialized.name] = true; @@ -39137,7 +39035,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha display: "flex", flexDirection: "column" }); - const PickersLayout = function PickersLayout2(inProps) { + const PickersLayout = /* @__PURE__ */ React__namespace.forwardRef(function PickersLayout2(inProps, ref) { const props = useThemeProps({ props: inProps, name: "MuiPickersLayout" @@ -39153,7 +39051,6 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha sx, className, isLandscape, - ref, wrapperVariant } = props; const classes = useUtilityClasses$J(props); @@ -39171,7 +39068,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }) }), actionBar] }); - }; + }); process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | @@ -45075,7 +44972,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha function getPickersArrowSwitcherUtilityClass(slot) { return generateUtilityClass("MuiPickersArrowSwitcher", slot); } - const pickersArrowSwitcherClasses = generateUtilityClasses("MuiPickersArrowSwitcher", ["root", "spacer", "button"]); + const pickersArrowSwitcherClasses = generateUtilityClasses("MuiPickersArrowSwitcher", ["root", "spacer", "button", "previousIconButton", "nextIconButton", "leftArrowIcon", "rightArrowIcon"]); const _excluded$E = ["children", "className", "slots", "slotProps", "isNextDisabled", "isNextHidden", "onGoToNext", "nextLabel", "isPreviousDisabled", "isPreviousHidden", "onGoToPrevious", "previousLabel", "labelId"], _excluded2$3 = ["ownerState"], _excluded3$1 = ["ownerState"]; const PickersArrowSwitcherRoot = styled$1("div", { name: "MuiPickersArrowSwitcher", @@ -45114,7 +45011,11 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha const slots = { root: ["root"], spacer: ["spacer"], - button: ["button"] + button: ["button"], + previousIconButton: ["previousIconButton"], + nextIconButton: ["nextIconButton"], + leftArrowIcon: ["leftArrowIcon"], + rightArrowIcon: ["rightArrowIcon"] }; return composeClasses(slots, getPickersArrowSwitcherUtilityClass, classes); }; @@ -45169,7 +45070,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha ownerState: _extends$1({}, ownerState, { hidden: previousProps.isHidden }), - className: classes.button + className: clsx(classes.button, classes.previousIconButton) }); const NextIconButton = (_b = slots == null ? void 0 : slots.nextIconButton) != null ? _b : PickersArrowSwitcherButton; const nextIconButtonProps = useSlotProps({ @@ -45186,7 +45087,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha ownerState: _extends$1({}, ownerState, { hidden: nextProps.isHidden }), - className: classes.button + className: clsx(classes.button, classes.nextIconButton) }); const LeftArrowIcon = (_c = slots == null ? void 0 : slots.leftArrowIcon) != null ? _c : ArrowLeftIcon; const _useSlotProps = useSlotProps({ @@ -45195,7 +45096,8 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha additionalProps: { fontSize: "inherit" }, - ownerState: void 0 + ownerState, + className: classes.leftArrowIcon }), leftArrowIconProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2$3); const RightArrowIcon = (_d = slots == null ? void 0 : slots.rightArrowIcon) != null ? _d : ArrowRightIcon; const _useSlotProps2 = useSlotProps({ @@ -45204,7 +45106,8 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha additionalProps: { fontSize: "inherit" }, - ownerState: void 0 + ownerState, + className: classes.rightArrowIcon }), rightArrowIconProps = _objectWithoutPropertiesLoose(_useSlotProps2, _excluded3$1); return /* @__PURE__ */ jsxRuntimeExports.jsxs(PickersArrowSwitcherRoot, _extends$1({ ref, @@ -45385,7 +45288,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha const _useSlotProps = useSlotProps({ elementType: SwitchViewIcon, externalSlotProps: slotProps == null ? void 0 : slotProps.switchViewIcon, - ownerState: void 0, + ownerState, className: classes.switchViewIcon }), switchViewIconProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2$2); const selectNextMonth = () => onMonthChange(utils2.addMonths(month, 1), "left"); @@ -50315,10 +50218,11 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha function getClockUtilityClass(slot) { return generateUtilityClass("MuiClock", slot); } - const clockClasses = generateUtilityClasses("MuiClock", ["root", "clock", "wrapper", "squareMask", "pin", "amButton", "pmButton", "meridiemText"]); + const clockClasses = generateUtilityClasses("MuiClock", ["root", "clock", "wrapper", "squareMask", "pin", "amButton", "pmButton", "meridiemText", "selected"]); const useUtilityClasses$h = (ownerState) => { const { - classes + classes, + meridiemMode } = ownerState; const slots = { root: ["root"], @@ -50326,8 +50230,8 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha wrapper: ["wrapper"], squareMask: ["squareMask"], pin: ["pin"], - amButton: ["amButton"], - pmButton: ["pmButton"], + amButton: ["amButton", meridiemMode === "am" && "selected"], + pmButton: ["pmButton", meridiemMode === "pm" && "selected"], meridiemText: ["meridiemText"] }; return composeClasses(slots, getClockUtilityClass, classes); @@ -50410,23 +50314,15 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha left: "50%", transform: "translate(-50%, -50%)" })); - const ClockAmButton = styled$1(IconButton, { - name: "MuiClock", - slot: "AmButton", - overridesResolver: (_2, styles2) => styles2.amButton - })(({ - theme - }) => ({ + const meridiemButtonCommonStyles = (theme, meridiemMode) => ({ zIndex: 1, - position: "absolute", bottom: 8, - left: 8, paddingLeft: 4, paddingRight: 4, width: CLOCK_HOUR_WIDTH, variants: [{ props: { - meridiemMode: "am" + meridiemMode }, style: { backgroundColor: (theme.vars || theme).palette.primary.main, @@ -50436,6 +50332,17 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha } } }] + }); + const ClockAmButton = styled$1(IconButton, { + name: "MuiClock", + slot: "AmButton", + overridesResolver: (_2, styles2) => styles2.amButton + })(({ + theme + }) => _extends$1({}, meridiemButtonCommonStyles(theme, "am"), { + // keeping it here to make TS happy + position: "absolute", + left: 8 })); const ClockPmButton = styled$1(IconButton, { name: "MuiClock", @@ -50443,26 +50350,10 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha overridesResolver: (_2, styles2) => styles2.pmButton })(({ theme - }) => ({ - zIndex: 1, + }) => _extends$1({}, meridiemButtonCommonStyles(theme, "pm"), { + // keeping it here to make TS happy position: "absolute", - bottom: 8, - right: 8, - paddingLeft: 4, - paddingRight: 4, - width: CLOCK_HOUR_WIDTH, - variants: [{ - props: { - meridiemMode: "pm" - }, - style: { - backgroundColor: (theme.vars || theme).palette.primary.main, - color: (theme.vars || theme).palette.primary.contrastText, - "&:hover": { - backgroundColor: (theme.vars || theme).palette.primary.light - } - } - }] + right: 8 })); const ClockMeridiemText = styled$1(Typography, { name: "MuiClock", @@ -52529,7 +52420,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha skipDisabled, timezone }); - function DesktopDateTimePickerLayout(props) { + const DesktopDateTimePickerLayout = /* @__PURE__ */ React__namespace.forwardRef(function DesktopDateTimePickerLayout2(props, ref) { var _a, _b; const isRtl = useRtl(); const { @@ -52543,7 +52434,6 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha sx, className, isLandscape, - ref, classes } = props; const isActionBarVisible = actionBar && ((_b = (_a = actionBar.props.actions) == null ? void 0 : _a.length) != null ? _b : 0) > 0; @@ -52576,7 +52466,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha })] }), actionBar] }); - } + }); process.env.NODE_ENV !== "production" ? DesktopDateTimePickerLayout.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | @@ -64794,6 +64684,40 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha _formControl.current.formState = getProxyFormState(formState, control); return _formControl.current; } + function BasicEntityAutocompleteField(props) { + const { spec } = props; + const { field, getValues, control } = spec; + const val = getValues(field.name); + return /* @__PURE__ */ jsxRuntimeExports.jsx( + Controller, + { + name: field.name, + control, + defaultValue: resolveOptions(field.options.default), + render: ({ field: { onChange, value } }) => /* @__PURE__ */ jsxRuntimeExports.jsx( + material.Autocomplete, + { + freeSolo: true, + forcePopupIcon: true, + multiple: field.ux.multiple, + options: resolveOptions(field.options.ents), + isOptionEqualToValue: (option, value2) => option.value === value2.value, + getOptionLabel: (option) => option.label, + value, + onChange: (e, val2) => onChange(val2), + renderInput: (params) => /* @__PURE__ */ jsxRuntimeExports.jsx(material.TextField, __spreadProps(__spreadValues({}, params), { label: field.label })) + }, + field.id + ) + } + ); + } + function resolveOptions(options) { + return Object.keys(options).map((key) => ({ + label: options[key].label, + value: key + })); + } const CMPNAME$8 = "BasicEntityField"; const { Open: Open$6 } = gubu_minExports.Gubu; const BasicEntityFieldSpecShape = gubu_minExports.Gubu(Open$6({}), { name: CMPNAME$8 }); @@ -64802,7 +64726,8 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha TextBox: BasicEntityTextBoxField, Date: BasicEntityDateField, DateTime: BasicEntityDateTimeField, - Time: BasicEntityTimeField + Time: BasicEntityTimeField, + Autocomplete: BasicEntityAutocompleteField }; function BasicEntityField(props) { const { ctx, spec } = props; @@ -65013,6 +64938,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha handleSubmit, getValues, reset, + control, formState: { errors } } = useForm({ mode: "onChange", @@ -65041,6 +64967,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha field, register, getValues, + control, errors } } diff --git a/src/lib/BasicEntityAutocompleteField.tsx b/src/lib/BasicEntityAutocompleteField.tsx new file mode 100644 index 0000000..b2443a2 --- /dev/null +++ b/src/lib/BasicEntityAutocompleteField.tsx @@ -0,0 +1,44 @@ +import React, { useEffect, forwardRef } from "react"; + +import { FormControlLabel, Checkbox, Box, RadioGroup, Radio, FormLabel, TextField, Autocomplete } from "@mui/material"; +import { Controller } from "react-hook-form"; + + + +function BasicEntityAutocompleteField(props: any) { + const { spec } = props + + const { field, getValues, control } = spec + const val = getValues(field.name) + + return ( + ( + option.value === value.value} + getOptionLabel={(option: any) => option.label} + value={value} + onChange={(e: any, val: any) => onChange(val)} + renderInput={(params: any) => } + /> + )} + /> + ) +} + +function resolveOptions(options: any) { + return Object.keys(options).map(key => ({ + label: options[key].label, + value: key + })); +} + +export { BasicEntityAutocompleteField }; \ No newline at end of file diff --git a/src/lib/BasicEntityEdit.tsx b/src/lib/BasicEntityEdit.tsx index 3966ab2..391dd3c 100644 --- a/src/lib/BasicEntityEdit.tsx +++ b/src/lib/BasicEntityEdit.tsx @@ -124,6 +124,7 @@ function BasicEntityEdit (props: any) { handleSubmit, getValues, reset, + control, formState: { errors }, } = useForm({ mode: 'onChange', @@ -155,6 +156,7 @@ function BasicEntityEdit (props: any) { field, register, getValues, + control, errors, }} /> diff --git a/src/lib/BasicEntityField.tsx b/src/lib/BasicEntityField.tsx index f332b15..d4b70b8 100644 --- a/src/lib/BasicEntityField.tsx +++ b/src/lib/BasicEntityField.tsx @@ -10,6 +10,7 @@ import { import type { Spec } from './basic-types' import { Gubu } from 'gubu' +import { BasicEntityAutocompleteField } from './BasicEntityAutocompleteField' const CMPNAME = 'BasicEntityField' @@ -26,6 +27,7 @@ const fieldMap: any = { Date: BasicEntityDateField, DateTime: BasicEntityDateTimeField, Time: BasicEntityTimeField, + Autocomplete: BasicEntityAutocompleteField } From aea72fb573d13006b73f38bc328bc5202b00ee89 Mon Sep 17 00:00:00 2001 From: Zack Braksa Date: Thu, 25 Jul 2024 02:18:20 +0100 Subject: [PATCH 02/12] Refactor BasicEntityAutocompleteField component --- dist/voxgig-model-react.es.js | 80 ++++++++++++++------- dist/voxgig-model-react.umd.js | 80 ++++++++++++++------- src/lib/BasicEntityAutocompleteField.tsx | 90 +++++++++++++++++++++--- 3 files changed, 190 insertions(+), 60 deletions(-) diff --git a/dist/voxgig-model-react.es.js b/dist/voxgig-model-react.es.js index 8170af1..51e6d77 100644 --- a/dist/voxgig-model-react.es.js +++ b/dist/voxgig-model-react.es.js @@ -10588,8 +10588,8 @@ process.env.NODE_ENV !== "production" ? Toolbar.propTypes = { */ variant: PropTypes.oneOfType([PropTypes.oneOf(["dense", "regular"]), PropTypes.string]) } : void 0; -const CMPNAME$c = "BasicAccountTool"; -console.log(CMPNAME$c, "1"); +const CMPNAME$d = "BasicAccountTool"; +console.log(CMPNAME$d, "1"); const { Exact: Exact$2 } = gubu_minExports.Gubu; const BasicAccountToolSpecShape = gubu_minExports.Gubu({ name: String, @@ -10599,7 +10599,7 @@ const BasicAccountToolSpecShape = gubu_minExports.Gubu({ attr: {}, sx: {}, style: {} -}, { name: CMPNAME$c }); +}, { name: CMPNAME$d }); function BasicAccountTool(props) { var _a; const { ctx, spec } = props; @@ -10673,8 +10673,8 @@ function stringAvatar(s) { children: `${parts.join("")}` }; } -const CMPNAME$b = "BasicHeadTool"; -console.log(CMPNAME$b, "1"); +const CMPNAME$c = "BasicHeadTool"; +console.log(CMPNAME$c, "1"); const { Exact: Exact$1 } = gubu_minExports.Gubu; const BasicHeadToolSpecShape = gubu_minExports.Gubu({ name: String, @@ -10684,7 +10684,7 @@ const BasicHeadToolSpecShape = gubu_minExports.Gubu({ attr: {}, sx: {}, style: {} -}, { name: CMPNAME$b }); +}, { name: CMPNAME$c }); function BasicHeadTool(props) { const { ctx, spec } = props; const { seneca } = ctx(); @@ -10693,7 +10693,7 @@ function BasicHeadTool(props) { const { name, kind, attr, sx, style: style2 } = basicHeadToolSpec; let tool = /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}); if ("" === kind) { - console.warn(CMPNAME$b, "empty-tool-kind", basicHeadToolSpec); + console.warn(CMPNAME$c, "empty-tool-kind", basicHeadToolSpec); } else if ("logo" === kind) { tool = /* @__PURE__ */ jsxRuntimeExports.jsxs( "div", @@ -10710,7 +10710,7 @@ function BasicHeadTool(props) { { href: "/", style: style2, - className: `vxg-${CMPNAME$b}-logo`, + className: `vxg-${CMPNAME$c}-logo`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: attr.img }) } ), @@ -10742,17 +10742,17 @@ function BasicHeadTool(props) { } else if ("account" === kind) { tool = /* @__PURE__ */ jsxRuntimeExports.jsx(BasicAccountTool, { ctx, spec }); } else { - console.warn(CMPNAME$b, "unknown-tool-kind", kind, basicHeadToolSpec); + console.warn(CMPNAME$c, "unknown-tool-kind", kind, basicHeadToolSpec); } return tool; } -const CMPNAME$a = "BasicHead"; -const { Child: Child$5, Exact, Open: Open$8, Required: Required$1 } = gubu_minExports.Gubu; +const CMPNAME$b = "BasicHead"; +const { Child: Child$5, Exact, Open: Open$9, Required: Required$1 } = gubu_minExports.Gubu; const BasicHeadSpecShape = gubu_minExports.Gubu({ head: { name: String, active: Boolean, - tool: Child$5(Open$8({ + tool: Child$5(Open$9({ align: Exact("left", "right") })) }, @@ -10762,7 +10762,7 @@ const BasicHeadSpecShape = gubu_minExports.Gubu({ AppBar: {}, ToolBar: {} } -}, { name: CMPNAME$a }); +}, { name: CMPNAME$b }); function BasicHead(props) { const { ctx, spec } = props; const { seneca } = ctx(); @@ -62706,8 +62706,8 @@ const MaterialReactTable = (props) => { } return jsxRuntimeExports.jsx(MRT_TablePaper, { table }); }; -const { Open: Open$7, Child: Child$4 } = gubu_minExports.Gubu; -const Shape$2 = gubu_minExports.Gubu(Open$7({ +const { Open: Open$8, Child: Child$4 } = gubu_minExports.Gubu; +const Shape$2 = gubu_minExports.Gubu(Open$8({ name: String, prefix: String, ent: String, @@ -62752,7 +62752,7 @@ Object.assign(VxgBasicEntityListPlugin, { } }); Object.defineProperty(VxgBasicEntityListPlugin, "name", { value: "VxgBasicEntityListPlugin" }); -const CMPNAME$9 = "BasicEntityList"; +const CMPNAME$a = "BasicEntityList"; function BasicEntityList(props) { const { ctx } = props; const { seneca } = ctx(); @@ -64672,27 +64672,49 @@ function useForm(props = {}) { _formControl.current.formState = getProxyFormState(formState, control); return _formControl.current; } +const CMPNAME$9 = "BasicEntityAutocompleteField"; +const { Open: Open$7 } = gubu_minExports.Gubu; +const BasicEntityAutocompleteFieldSpecShape = gubu_minExports.Gubu(Open$7({ + field: Open$7({ + id: String, + name: gubu_minExports.Default("", String), + label: gubu_minExports.Default("", String), + multiple: gubu_minExports.Default(false, Boolean), + options: Open$7({ + default: Open$7({}), + label: { field: gubu_minExports.Default("label", String) }, + multiple: gubu_minExports.Default(false, Boolean), + ents: Open$7({}) + }), + ux: Open$7({ + kind: gubu_minExports.Default("Text", String), + edit: gubu_minExports.Default(true, Boolean) + }) + }), + errors: Open$7({}) +}), { name: CMPNAME$9 }); function BasicEntityAutocompleteField(props) { const { spec } = props; - const { field, getValues, control } = spec; - const val = getValues(field.name); + const basicEntityAutocompleteField = BasicEntityAutocompleteFieldSpecShape(spec); + const { control, field } = basicEntityAutocompleteField; + const { resolvedOptions, resolvedDefault } = resolveOptions(field.options); return /* @__PURE__ */ jsxRuntimeExports.jsx( Controller, { name: field.name, control, - defaultValue: resolveOptions(field.options.default), + defaultValue: resolvedDefault, render: ({ field: { onChange, value } }) => /* @__PURE__ */ jsxRuntimeExports.jsx( Autocomplete$1, { freeSolo: true, forcePopupIcon: true, - multiple: field.ux.multiple, - options: resolveOptions(field.options.ents), - isOptionEqualToValue: (option, value2) => option.value === value2.value, + multiple: field.options.multiple, + options: resolvedOptions, + isOptionEqualToValue: (opt, val) => opt === val || (opt == null ? void 0 : opt.id) != null && (val == null ? void 0 : val.id) != null && opt.id === val.id || (opt == null ? void 0 : opt.value) != null && (val == null ? void 0 : val.value) != null && opt.value === val.value, getOptionLabel: (option) => option.label, value, - onChange: (e, val2) => onChange(val2), + onChange: (e, val) => onChange(val), renderInput: (params) => /* @__PURE__ */ jsxRuntimeExports.jsx(TextField$1, __spreadProps(__spreadValues({}, params), { label: field.label })) }, field.id @@ -64701,10 +64723,18 @@ function BasicEntityAutocompleteField(props) { ); } function resolveOptions(options) { - return Object.keys(options).map((key) => ({ - label: options[key].label, + const resolvedOptions = Object.keys(options.ents).map((key) => ({ + label: options.ents[key].label, value: key })); + const resolvedDefault = options.multiple === false ? Object.keys(options.default).length > 0 ? { value: Object.keys(options.default)[0], label: options.default[Object.keys(options.default)[0]].label } : null : Object.keys(options.default).map((key) => ({ + label: options.default[key].label, + value: key + })); + return { + resolvedOptions, + resolvedDefault + }; } const CMPNAME$8 = "BasicEntityField"; const { Open: Open$6 } = gubu_minExports.Gubu; diff --git a/dist/voxgig-model-react.umd.js b/dist/voxgig-model-react.umd.js index 4b5d9b2..9668a02 100644 --- a/dist/voxgig-model-react.umd.js +++ b/dist/voxgig-model-react.umd.js @@ -10600,8 +10600,8 @@ try { */ variant: PropTypes.oneOfType([PropTypes.oneOf(["dense", "regular"]), PropTypes.string]) } : void 0; - const CMPNAME$c = "BasicAccountTool"; - console.log(CMPNAME$c, "1"); + const CMPNAME$d = "BasicAccountTool"; + console.log(CMPNAME$d, "1"); const { Exact: Exact$2 } = gubu_minExports.Gubu; const BasicAccountToolSpecShape = gubu_minExports.Gubu({ name: String, @@ -10611,7 +10611,7 @@ try { attr: {}, sx: {}, style: {} - }, { name: CMPNAME$c }); + }, { name: CMPNAME$d }); function BasicAccountTool(props) { var _a; const { ctx, spec } = props; @@ -10685,8 +10685,8 @@ try { children: `${parts.join("")}` }; } - const CMPNAME$b = "BasicHeadTool"; - console.log(CMPNAME$b, "1"); + const CMPNAME$c = "BasicHeadTool"; + console.log(CMPNAME$c, "1"); const { Exact: Exact$1 } = gubu_minExports.Gubu; const BasicHeadToolSpecShape = gubu_minExports.Gubu({ name: String, @@ -10696,7 +10696,7 @@ try { attr: {}, sx: {}, style: {} - }, { name: CMPNAME$b }); + }, { name: CMPNAME$c }); function BasicHeadTool(props) { const { ctx, spec } = props; const { seneca } = ctx(); @@ -10705,7 +10705,7 @@ try { const { name, kind, attr, sx, style: style2 } = basicHeadToolSpec; let tool = /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}); if ("" === kind) { - console.warn(CMPNAME$b, "empty-tool-kind", basicHeadToolSpec); + console.warn(CMPNAME$c, "empty-tool-kind", basicHeadToolSpec); } else if ("logo" === kind) { tool = /* @__PURE__ */ jsxRuntimeExports.jsxs( "div", @@ -10722,7 +10722,7 @@ try { { href: "/", style: style2, - className: `vxg-${CMPNAME$b}-logo`, + className: `vxg-${CMPNAME$c}-logo`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: attr.img }) } ), @@ -10754,17 +10754,17 @@ try { } else if ("account" === kind) { tool = /* @__PURE__ */ jsxRuntimeExports.jsx(BasicAccountTool, { ctx, spec }); } else { - console.warn(CMPNAME$b, "unknown-tool-kind", kind, basicHeadToolSpec); + console.warn(CMPNAME$c, "unknown-tool-kind", kind, basicHeadToolSpec); } return tool; } - const CMPNAME$a = "BasicHead"; - const { Child: Child$5, Exact, Open: Open$8, Required: Required$1 } = gubu_minExports.Gubu; + const CMPNAME$b = "BasicHead"; + const { Child: Child$5, Exact, Open: Open$9, Required: Required$1 } = gubu_minExports.Gubu; const BasicHeadSpecShape = gubu_minExports.Gubu({ head: { name: String, active: Boolean, - tool: Child$5(Open$8({ + tool: Child$5(Open$9({ align: Exact("left", "right") })) }, @@ -10774,7 +10774,7 @@ try { AppBar: {}, ToolBar: {} } - }, { name: CMPNAME$a }); + }, { name: CMPNAME$b }); function BasicHead(props) { const { ctx, spec } = props; const { seneca } = ctx(); @@ -62718,8 +62718,8 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha } return jsxRuntimeExports.jsx(MRT_TablePaper, { table }); }; - const { Open: Open$7, Child: Child$4 } = gubu_minExports.Gubu; - const Shape$2 = gubu_minExports.Gubu(Open$7({ + const { Open: Open$8, Child: Child$4 } = gubu_minExports.Gubu; + const Shape$2 = gubu_minExports.Gubu(Open$8({ name: String, prefix: String, ent: String, @@ -62764,7 +62764,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha } }); Object.defineProperty(VxgBasicEntityListPlugin, "name", { value: "VxgBasicEntityListPlugin" }); - const CMPNAME$9 = "BasicEntityList"; + const CMPNAME$a = "BasicEntityList"; function BasicEntityList(props) { const { ctx } = props; const { seneca } = ctx(); @@ -64684,27 +64684,49 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha _formControl.current.formState = getProxyFormState(formState, control); return _formControl.current; } + const CMPNAME$9 = "BasicEntityAutocompleteField"; + const { Open: Open$7 } = gubu_minExports.Gubu; + const BasicEntityAutocompleteFieldSpecShape = gubu_minExports.Gubu(Open$7({ + field: Open$7({ + id: String, + name: gubu_minExports.Default("", String), + label: gubu_minExports.Default("", String), + multiple: gubu_minExports.Default(false, Boolean), + options: Open$7({ + default: Open$7({}), + label: { field: gubu_minExports.Default("label", String) }, + multiple: gubu_minExports.Default(false, Boolean), + ents: Open$7({}) + }), + ux: Open$7({ + kind: gubu_minExports.Default("Text", String), + edit: gubu_minExports.Default(true, Boolean) + }) + }), + errors: Open$7({}) + }), { name: CMPNAME$9 }); function BasicEntityAutocompleteField(props) { const { spec } = props; - const { field, getValues, control } = spec; - const val = getValues(field.name); + const basicEntityAutocompleteField = BasicEntityAutocompleteFieldSpecShape(spec); + const { control, field } = basicEntityAutocompleteField; + const { resolvedOptions, resolvedDefault } = resolveOptions(field.options); return /* @__PURE__ */ jsxRuntimeExports.jsx( Controller, { name: field.name, control, - defaultValue: resolveOptions(field.options.default), + defaultValue: resolvedDefault, render: ({ field: { onChange, value } }) => /* @__PURE__ */ jsxRuntimeExports.jsx( material.Autocomplete, { freeSolo: true, forcePopupIcon: true, - multiple: field.ux.multiple, - options: resolveOptions(field.options.ents), - isOptionEqualToValue: (option, value2) => option.value === value2.value, + multiple: field.options.multiple, + options: resolvedOptions, + isOptionEqualToValue: (opt, val) => opt === val || (opt == null ? void 0 : opt.id) != null && (val == null ? void 0 : val.id) != null && opt.id === val.id || (opt == null ? void 0 : opt.value) != null && (val == null ? void 0 : val.value) != null && opt.value === val.value, getOptionLabel: (option) => option.label, value, - onChange: (e, val2) => onChange(val2), + onChange: (e, val) => onChange(val), renderInput: (params) => /* @__PURE__ */ jsxRuntimeExports.jsx(material.TextField, __spreadProps(__spreadValues({}, params), { label: field.label })) }, field.id @@ -64713,10 +64735,18 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha ); } function resolveOptions(options) { - return Object.keys(options).map((key) => ({ - label: options[key].label, + const resolvedOptions = Object.keys(options.ents).map((key) => ({ + label: options.ents[key].label, value: key })); + const resolvedDefault = options.multiple === false ? Object.keys(options.default).length > 0 ? { value: Object.keys(options.default)[0], label: options.default[Object.keys(options.default)[0]].label } : null : Object.keys(options.default).map((key) => ({ + label: options.default[key].label, + value: key + })); + return { + resolvedOptions, + resolvedDefault + }; } const CMPNAME$8 = "BasicEntityField"; const { Open: Open$6 } = gubu_minExports.Gubu; diff --git a/src/lib/BasicEntityAutocompleteField.tsx b/src/lib/BasicEntityAutocompleteField.tsx index b2443a2..ed8ad9e 100644 --- a/src/lib/BasicEntityAutocompleteField.tsx +++ b/src/lib/BasicEntityAutocompleteField.tsx @@ -1,29 +1,60 @@ import React, { useEffect, forwardRef } from "react"; -import { FormControlLabel, Checkbox, Box, RadioGroup, Radio, FormLabel, TextField, Autocomplete } from "@mui/material"; +import { TextField, Autocomplete } from "@mui/material"; import { Controller } from "react-hook-form"; +import type { Spec } from './basic-types' +import { Default, Gubu } from 'gubu' +const CMPNAME = 'BasicEntityAutocompleteField' + +const { Open } = Gubu +const BasicEntityAutocompleteFieldSpecShape = Gubu(Open({ + field: Open({ + id: String, + name: Default('', String), + label: Default('', String), + multiple: Default(false, Boolean), + options: Open({ + default: Open({}), + label: { field: Default('label', String) }, + multiple: Default(false, Boolean), + ents: Open({}) + }), + ux: Open({ + kind: Default('Text', String), + edit: Default(true, Boolean), + }) + }), + errors: Open({}), +}), {name: CMPNAME}) function BasicEntityAutocompleteField(props: any) { const { spec } = props - const { field, getValues, control } = spec - const val = getValues(field.name) + // console.log('BasicEntityAutocompleteField', spec) + + const basicEntityAutocompleteField: Spec = BasicEntityAutocompleteFieldSpecShape(spec) + const { control, field } = basicEntityAutocompleteField + const { resolvedOptions, resolvedDefault } = resolveOptions(field.options); return ( ( option.value === value.value} + multiple={field.options.multiple} + options={resolvedOptions} + isOptionEqualToValue={(opt: any, val: any) => + opt === val || + (opt?.id != null && val?.id != null && opt.id === val.id) || + (opt?.value != null && val?.value != null && opt.value === val.value) + } getOptionLabel={(option: any) => option.label} value={value} onChange={(e: any, val: any) => onChange(val)} @@ -35,10 +66,49 @@ function BasicEntityAutocompleteField(props: any) { } function resolveOptions(options: any) { - return Object.keys(options).map(key => ({ - label: options[key].label, + const resolvedOptions = Object.keys(options.ents).map(key => ({ + label: options.ents[key].label, value: key - })); + })) + + const resolvedDefault = options.multiple === false ? ( + Object.keys(options.default).length > 0 + ? { value: Object.keys(options.default)[0], label: options.default[Object.keys(options.default)[0]].label } + : null + ) : ( + Object.keys(options.default).map(key => ({ + label: options.default[key].label, + value: key + })) + ) + + return { + resolvedOptions, + resolvedDefault + } } +// function resolveDefaultValue(options: any) { +// if(options.multiple === false) { +// const keys = Object.keys(options.default); +// if (keys.length > 0) { +// return { key: keys[0], value: options.default[keys[0]] } +// } else { +// return null +// } +// } else { +// return Object.keys(options.default).map(key => ({ +// label: options.default[key].label, +// value: key +// })) +// } +// } + +// function resolveOptions(options: any) { +// return Object.keys(options.ents).map(key => ({ +// label: options.ents[key].label, +// value: key +// })) +// } + export { BasicEntityAutocompleteField }; \ No newline at end of file From 82165883939e259458806ba83e8befbc5d00b508 Mon Sep 17 00:00:00 2001 From: Zack Braksa Date: Thu, 25 Jul 2024 02:20:45 +0100 Subject: [PATCH 03/12] Remove unnecessary code from BasicEntityAutocompleteField --- src/lib/BasicEntityAutocompleteField.tsx | 25 +----------------------- 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/lib/BasicEntityAutocompleteField.tsx b/src/lib/BasicEntityAutocompleteField.tsx index ed8ad9e..3ea442b 100644 --- a/src/lib/BasicEntityAutocompleteField.tsx +++ b/src/lib/BasicEntityAutocompleteField.tsx @@ -88,27 +88,4 @@ function resolveOptions(options: any) { } } -// function resolveDefaultValue(options: any) { -// if(options.multiple === false) { -// const keys = Object.keys(options.default); -// if (keys.length > 0) { -// return { key: keys[0], value: options.default[keys[0]] } -// } else { -// return null -// } -// } else { -// return Object.keys(options.default).map(key => ({ -// label: options.default[key].label, -// value: key -// })) -// } -// } - -// function resolveOptions(options: any) { -// return Object.keys(options.ents).map(key => ({ -// label: options.ents[key].label, -// value: key -// })) -// } - -export { BasicEntityAutocompleteField }; \ No newline at end of file +export { BasicEntityAutocompleteField } \ No newline at end of file From 2375bb59335d78ddb3d3fe9657165e25baa00a7d Mon Sep 17 00:00:00 2001 From: Zack Braksa Date: Thu, 25 Jul 2024 02:25:21 +0100 Subject: [PATCH 04/12] adjust gubu shape for BasicEntityAutocompleteField --- dist/voxgig-model-react.es.js | 4 ++-- dist/voxgig-model-react.umd.js | 4 ++-- src/lib/BasicEntityAutocompleteField.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/voxgig-model-react.es.js b/dist/voxgig-model-react.es.js index 51e6d77..1d07ae6 100644 --- a/dist/voxgig-model-react.es.js +++ b/dist/voxgig-model-react.es.js @@ -64677,9 +64677,9 @@ const { Open: Open$7 } = gubu_minExports.Gubu; const BasicEntityAutocompleteFieldSpecShape = gubu_minExports.Gubu(Open$7({ field: Open$7({ id: String, - name: gubu_minExports.Default("", String), + name: String, + kind: String, label: gubu_minExports.Default("", String), - multiple: gubu_minExports.Default(false, Boolean), options: Open$7({ default: Open$7({}), label: { field: gubu_minExports.Default("label", String) }, diff --git a/dist/voxgig-model-react.umd.js b/dist/voxgig-model-react.umd.js index 9668a02..e2d491d 100644 --- a/dist/voxgig-model-react.umd.js +++ b/dist/voxgig-model-react.umd.js @@ -64689,9 +64689,9 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha const BasicEntityAutocompleteFieldSpecShape = gubu_minExports.Gubu(Open$7({ field: Open$7({ id: String, - name: gubu_minExports.Default("", String), + name: String, + kind: String, label: gubu_minExports.Default("", String), - multiple: gubu_minExports.Default(false, Boolean), options: Open$7({ default: Open$7({}), label: { field: gubu_minExports.Default("label", String) }, diff --git a/src/lib/BasicEntityAutocompleteField.tsx b/src/lib/BasicEntityAutocompleteField.tsx index 3ea442b..4d6704d 100644 --- a/src/lib/BasicEntityAutocompleteField.tsx +++ b/src/lib/BasicEntityAutocompleteField.tsx @@ -12,9 +12,9 @@ const { Open } = Gubu const BasicEntityAutocompleteFieldSpecShape = Gubu(Open({ field: Open({ id: String, - name: Default('', String), + name: String, + kind: String, label: Default('', String), - multiple: Default(false, Boolean), options: Open({ default: Open({}), label: { field: Default('label', String) }, From 9ade7be773d47a02bafc827c19ee24d5fa5b103d Mon Sep 17 00:00:00 2001 From: Zack Braksa Date: Thu, 25 Jul 2024 03:20:44 +0100 Subject: [PATCH 05/12] change variable name to avoid confusion with other BasicEntityField components --- dist/BasicEntitySliderField.d.ts | 2 ++ dist/voxgig-model-react.es.js | 2 +- dist/voxgig-model-react.umd.js | 2 +- src/lib/BasicEntityAutocompleteField.tsx | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 dist/BasicEntitySliderField.d.ts diff --git a/dist/BasicEntitySliderField.d.ts b/dist/BasicEntitySliderField.d.ts new file mode 100644 index 0000000..2e8f094 --- /dev/null +++ b/dist/BasicEntitySliderField.d.ts @@ -0,0 +1,2 @@ +declare function BasicEntitySliderField(props: any): import("react/jsx-runtime").JSX.Element; +export { BasicEntitySliderField }; diff --git a/dist/voxgig-model-react.es.js b/dist/voxgig-model-react.es.js index 1d07ae6..0ad131e 100644 --- a/dist/voxgig-model-react.es.js +++ b/dist/voxgig-model-react.es.js @@ -64714,7 +64714,7 @@ function BasicEntityAutocompleteField(props) { isOptionEqualToValue: (opt, val) => opt === val || (opt == null ? void 0 : opt.id) != null && (val == null ? void 0 : val.id) != null && opt.id === val.id || (opt == null ? void 0 : opt.value) != null && (val == null ? void 0 : val.value) != null && opt.value === val.value, getOptionLabel: (option) => option.label, value, - onChange: (e, val) => onChange(val), + onChange: (_2, nweValue) => onChange(nweValue), renderInput: (params) => /* @__PURE__ */ jsxRuntimeExports.jsx(TextField$1, __spreadProps(__spreadValues({}, params), { label: field.label })) }, field.id diff --git a/dist/voxgig-model-react.umd.js b/dist/voxgig-model-react.umd.js index e2d491d..d3fa045 100644 --- a/dist/voxgig-model-react.umd.js +++ b/dist/voxgig-model-react.umd.js @@ -64726,7 +64726,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha isOptionEqualToValue: (opt, val) => opt === val || (opt == null ? void 0 : opt.id) != null && (val == null ? void 0 : val.id) != null && opt.id === val.id || (opt == null ? void 0 : opt.value) != null && (val == null ? void 0 : val.value) != null && opt.value === val.value, getOptionLabel: (option) => option.label, value, - onChange: (e, val) => onChange(val), + onChange: (_2, nweValue) => onChange(nweValue), renderInput: (params) => /* @__PURE__ */ jsxRuntimeExports.jsx(material.TextField, __spreadProps(__spreadValues({}, params), { label: field.label })) }, field.id diff --git a/src/lib/BasicEntityAutocompleteField.tsx b/src/lib/BasicEntityAutocompleteField.tsx index 4d6704d..99fdce3 100644 --- a/src/lib/BasicEntityAutocompleteField.tsx +++ b/src/lib/BasicEntityAutocompleteField.tsx @@ -57,7 +57,7 @@ function BasicEntityAutocompleteField(props: any) { } getOptionLabel={(option: any) => option.label} value={value} - onChange={(e: any, val: any) => onChange(val)} + onChange={(_, nweValue: any) => onChange(nweValue)} renderInput={(params: any) => } /> )} From d80ae75b6e2ecd0ea5fd0257895a695c32d6e045 Mon Sep 17 00:00:00 2001 From: Zack Braksa Date: Thu, 25 Jul 2024 03:22:11 +0100 Subject: [PATCH 06/12] add comment to resolveOptions in BasicEntityAutocompleteField --- src/lib/BasicEntityAutocompleteField.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/BasicEntityAutocompleteField.tsx b/src/lib/BasicEntityAutocompleteField.tsx index 99fdce3..dfbc948 100644 --- a/src/lib/BasicEntityAutocompleteField.tsx +++ b/src/lib/BasicEntityAutocompleteField.tsx @@ -65,12 +65,15 @@ function BasicEntityAutocompleteField(props: any) { ) } +// Returns array of options and default value(s) based on the options object function resolveOptions(options: any) { + // Array of options const resolvedOptions = Object.keys(options.ents).map(key => ({ label: options.ents[key].label, value: key })) + // Array of default values (or single value if multiple is false) const resolvedDefault = options.multiple === false ? ( Object.keys(options.default).length > 0 ? { value: Object.keys(options.default)[0], label: options.default[Object.keys(options.default)[0]].label } From 94e0f03f5fd15af06c7a25fd8b3626ca7d98f9de Mon Sep 17 00:00:00 2001 From: Zack Braksa Date: Thu, 25 Jul 2024 18:56:58 +0100 Subject: [PATCH 07/12] update gubu shape on BasicEntityAutocompleteField --- src/lib/BasicEntityAutocompleteField.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/BasicEntityAutocompleteField.tsx b/src/lib/BasicEntityAutocompleteField.tsx index dfbc948..d257600 100644 --- a/src/lib/BasicEntityAutocompleteField.tsx +++ b/src/lib/BasicEntityAutocompleteField.tsx @@ -5,7 +5,7 @@ import { Controller } from "react-hook-form"; import type { Spec } from './basic-types' -import { Default, Gubu } from 'gubu' +import { Default, Exact, Gubu } from 'gubu' const CMPNAME = 'BasicEntityAutocompleteField' const { Open } = Gubu @@ -14,16 +14,16 @@ const BasicEntityAutocompleteFieldSpecShape = Gubu(Open({ id: String, name: String, kind: String, - label: Default('', String), + label: Default(''), options: Open({ default: Open({}), - label: { field: Default('label', String) }, - multiple: Default(false, Boolean), + label: { field: Default('label') }, + multiple: Default(false), ents: Open({}) }), ux: Open({ - kind: Default('Text', String), - edit: Default(true, Boolean), + kind: Exact('Autocomplete'), + edit: Default(true), }) }), errors: Open({}), From fd7ef677050de40f9dfb8e9c7d1542c08130d98c Mon Sep 17 00:00:00 2001 From: Zack Braksa Date: Thu, 25 Jul 2024 18:57:22 +0100 Subject: [PATCH 08/12] Tie getOptionLabel to model --- dist/voxgig-model-react.es.js | 104 +++++++++++------------ dist/voxgig-model-react.umd.js | 104 +++++++++++------------ src/lib/BasicEntityAutocompleteField.tsx | 4 +- 3 files changed, 100 insertions(+), 112 deletions(-) diff --git a/dist/voxgig-model-react.es.js b/dist/voxgig-model-react.es.js index 0ad131e..4c7817d 100644 --- a/dist/voxgig-model-react.es.js +++ b/dist/voxgig-model-react.es.js @@ -1030,21 +1030,15 @@ function requireReactJsxRuntime_development() { } return reactJsxRuntime_development; } -var jsxRuntime$1 = jsxRuntime$2.exports; -var hasRequiredJsxRuntime; -function requireJsxRuntime() { - if (hasRequiredJsxRuntime) return jsxRuntime$2.exports; - hasRequiredJsxRuntime = 1; - "use strict"; - if (process.env.NODE_ENV === "production") { - jsxRuntime$2.exports = requireReactJsxRuntime_production_min(); - } else { - jsxRuntime$2.exports = requireReactJsxRuntime_development(); - } - return jsxRuntime$2.exports; +var jsxRuntime = jsxRuntime$2.exports; +"use strict"; +if (process.env.NODE_ENV === "production") { + jsxRuntime$2.exports = requireReactJsxRuntime_production_min(); +} else { + jsxRuntime$2.exports = requireReactJsxRuntime_development(); } -var jsxRuntimeExports = requireJsxRuntime(); -const jsxRuntime = /* @__PURE__ */ getDefaultExportFromCjs(jsxRuntimeExports); +var jsxRuntimeExports = jsxRuntime$2.exports; +const jsxRuntime$1 = /* @__PURE__ */ getDefaultExportFromCjs(jsxRuntimeExports); var gubu_min$2 = { exports: {} }; var gubu_min = gubu_min$2.exports; (function(module, exports) { @@ -25311,7 +25305,7 @@ Object.defineProperty(ArrowDownward, "__esModule", { }); var default_1$x = ArrowDownward.default = void 0; var _createSvgIcon$x = _interopRequireDefault$x(requireCreateSvgIcon()); -var _jsxRuntime$x = requireJsxRuntime(); +var _jsxRuntime$x = jsxRuntimeExports; var _default$x = default_1$x = ArrowDownward.default = (0, _createSvgIcon$x.default)(/* @__PURE__ */ (0, _jsxRuntime$x.jsx)("path", { d: "m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z" }), "ArrowDownward"); @@ -25324,7 +25318,7 @@ Object.defineProperty(ArrowRight, "__esModule", { }); var default_1$w = ArrowRight.default = void 0; var _createSvgIcon$w = _interopRequireDefault$w(requireCreateSvgIcon()); -var _jsxRuntime$w = requireJsxRuntime(); +var _jsxRuntime$w = jsxRuntimeExports; var _default$w = default_1$w = ArrowRight.default = (0, _createSvgIcon$w.default)(/* @__PURE__ */ (0, _jsxRuntime$w.jsx)("path", { d: "m10 17 5-5-5-5z" }), "ArrowRight"); @@ -25337,7 +25331,7 @@ Object.defineProperty(Cancel, "__esModule", { }); var default_1$v = Cancel.default = void 0; var _createSvgIcon$v = _interopRequireDefault$v(requireCreateSvgIcon()); -var _jsxRuntime$v = requireJsxRuntime(); +var _jsxRuntime$v = jsxRuntimeExports; var _default$v = default_1$v = Cancel.default = (0, _createSvgIcon$v.default)(/* @__PURE__ */ (0, _jsxRuntime$v.jsx)("path", { d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z" }), "Cancel"); @@ -25350,7 +25344,7 @@ Object.defineProperty(ChevronLeft, "__esModule", { }); var default_1$u = ChevronLeft.default = void 0; var _createSvgIcon$u = _interopRequireDefault$u(requireCreateSvgIcon()); -var _jsxRuntime$u = requireJsxRuntime(); +var _jsxRuntime$u = jsxRuntimeExports; var _default$u = default_1$u = ChevronLeft.default = (0, _createSvgIcon$u.default)(/* @__PURE__ */ (0, _jsxRuntime$u.jsx)("path", { d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z" }), "ChevronLeft"); @@ -25363,7 +25357,7 @@ Object.defineProperty(ChevronRight, "__esModule", { }); var default_1$t = ChevronRight.default = void 0; var _createSvgIcon$t = _interopRequireDefault$t(requireCreateSvgIcon()); -var _jsxRuntime$t = requireJsxRuntime(); +var _jsxRuntime$t = jsxRuntimeExports; var _default$t = default_1$t = ChevronRight.default = (0, _createSvgIcon$t.default)(/* @__PURE__ */ (0, _jsxRuntime$t.jsx)("path", { d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }), "ChevronRight"); @@ -25376,7 +25370,7 @@ Object.defineProperty(ClearAll, "__esModule", { }); var default_1$s = ClearAll.default = void 0; var _createSvgIcon$s = _interopRequireDefault$s(requireCreateSvgIcon()); -var _jsxRuntime$s = requireJsxRuntime(); +var _jsxRuntime$s = jsxRuntimeExports; var _default$s = default_1$s = ClearAll.default = (0, _createSvgIcon$s.default)(/* @__PURE__ */ (0, _jsxRuntime$s.jsx)("path", { d: "M5 13h14v-2H5zm-2 4h14v-2H3zM7 7v2h14V7z" }), "ClearAll"); @@ -25389,7 +25383,7 @@ Object.defineProperty(Close, "__esModule", { }); var default_1$r = Close.default = void 0; var _createSvgIcon$r = _interopRequireDefault$r(requireCreateSvgIcon()); -var _jsxRuntime$r = requireJsxRuntime(); +var _jsxRuntime$r = jsxRuntimeExports; var _default$r = default_1$r = Close.default = (0, _createSvgIcon$r.default)(/* @__PURE__ */ (0, _jsxRuntime$r.jsx)("path", { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }), "Close"); @@ -25402,7 +25396,7 @@ Object.defineProperty(ContentCopy, "__esModule", { }); var default_1$q = ContentCopy.default = void 0; var _createSvgIcon$q = _interopRequireDefault$q(requireCreateSvgIcon()); -var _jsxRuntime$q = requireJsxRuntime(); +var _jsxRuntime$q = jsxRuntimeExports; var _default$q = default_1$q = ContentCopy.default = (0, _createSvgIcon$q.default)(/* @__PURE__ */ (0, _jsxRuntime$q.jsx)("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z" }), "ContentCopy"); @@ -25415,7 +25409,7 @@ Object.defineProperty(DensityLarge, "__esModule", { }); var default_1$p = DensityLarge.default = void 0; var _createSvgIcon$p = _interopRequireDefault$p(requireCreateSvgIcon()); -var _jsxRuntime$p = requireJsxRuntime(); +var _jsxRuntime$p = jsxRuntimeExports; var _default$p = default_1$p = DensityLarge.default = (0, _createSvgIcon$p.default)(/* @__PURE__ */ (0, _jsxRuntime$p.jsx)("path", { d: "M3 3h18v2H3zm0 16h18v2H3z" }), "DensityLarge"); @@ -25428,7 +25422,7 @@ Object.defineProperty(DensityMedium, "__esModule", { }); var default_1$o = DensityMedium.default = void 0; var _createSvgIcon$o = _interopRequireDefault$o(requireCreateSvgIcon()); -var _jsxRuntime$o = requireJsxRuntime(); +var _jsxRuntime$o = jsxRuntimeExports; var _default$o = default_1$o = DensityMedium.default = (0, _createSvgIcon$o.default)(/* @__PURE__ */ (0, _jsxRuntime$o.jsx)("path", { d: "M3 3h18v2H3zm0 16h18v2H3zm0-8h18v2H3z" }), "DensityMedium"); @@ -25441,7 +25435,7 @@ Object.defineProperty(DensitySmall, "__esModule", { }); var default_1$n = DensitySmall.default = void 0; var _createSvgIcon$n = _interopRequireDefault$n(requireCreateSvgIcon()); -var _jsxRuntime$n = requireJsxRuntime(); +var _jsxRuntime$n = jsxRuntimeExports; var _default$n = default_1$n = DensitySmall.default = (0, _createSvgIcon$n.default)(/* @__PURE__ */ (0, _jsxRuntime$n.jsx)("path", { d: "M3 2h18v2H3zm0 18h18v2H3zm0-6h18v2H3zm0-6h18v2H3z" }), "DensitySmall"); @@ -25454,7 +25448,7 @@ Object.defineProperty(DragHandle, "__esModule", { }); var default_1$m = DragHandle.default = void 0; var _createSvgIcon$m = _interopRequireDefault$m(requireCreateSvgIcon()); -var _jsxRuntime$m = requireJsxRuntime(); +var _jsxRuntime$m = jsxRuntimeExports; var _default$m = default_1$m = DragHandle.default = (0, _createSvgIcon$m.default)(/* @__PURE__ */ (0, _jsxRuntime$m.jsx)("path", { d: "M20 9H4v2h16zM4 15h16v-2H4z" }), "DragHandle"); @@ -25467,7 +25461,7 @@ Object.defineProperty(DynamicFeed, "__esModule", { }); var default_1$l = DynamicFeed.default = void 0; var _createSvgIcon$l = _interopRequireDefault$l(requireCreateSvgIcon()); -var _jsxRuntime$l = requireJsxRuntime(); +var _jsxRuntime$l = jsxRuntimeExports; var _default$l = default_1$l = DynamicFeed.default = (0, _createSvgIcon$l.default)([/* @__PURE__ */ (0, _jsxRuntime$l.jsx)("path", { d: "M8 8H6v7c0 1.1.9 2 2 2h9v-2H8z" }, "0"), /* @__PURE__ */ (0, _jsxRuntime$l.jsx)("path", { @@ -25482,7 +25476,7 @@ Object.defineProperty(Edit, "__esModule", { }); var default_1$k = Edit.default = void 0; var _createSvgIcon$k = _interopRequireDefault$k(requireCreateSvgIcon()); -var _jsxRuntime$k = requireJsxRuntime(); +var _jsxRuntime$k = jsxRuntimeExports; var _default$k = default_1$k = Edit.default = (0, _createSvgIcon$k.default)(/* @__PURE__ */ (0, _jsxRuntime$k.jsx)("path", { d: "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z" }), "Edit"); @@ -25495,7 +25489,7 @@ Object.defineProperty(ExpandMore, "__esModule", { }); var default_1$j = ExpandMore.default = void 0; var _createSvgIcon$j = _interopRequireDefault$j(requireCreateSvgIcon()); -var _jsxRuntime$j = requireJsxRuntime(); +var _jsxRuntime$j = jsxRuntimeExports; var _default$j = default_1$j = ExpandMore.default = (0, _createSvgIcon$j.default)(/* @__PURE__ */ (0, _jsxRuntime$j.jsx)("path", { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }), "ExpandMore"); @@ -25508,7 +25502,7 @@ Object.defineProperty(FilterAlt, "__esModule", { }); var default_1$i = FilterAlt.default = void 0; var _createSvgIcon$i = _interopRequireDefault$i(requireCreateSvgIcon()); -var _jsxRuntime$i = requireJsxRuntime(); +var _jsxRuntime$i = jsxRuntimeExports; var _default$i = default_1$i = FilterAlt.default = (0, _createSvgIcon$i.default)(/* @__PURE__ */ (0, _jsxRuntime$i.jsx)("path", { d: "M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61" }), "FilterAlt"); @@ -25521,7 +25515,7 @@ Object.defineProperty(FilterList, "__esModule", { }); var default_1$h = FilterList.default = void 0; var _createSvgIcon$h = _interopRequireDefault$h(requireCreateSvgIcon()); -var _jsxRuntime$h = requireJsxRuntime(); +var _jsxRuntime$h = jsxRuntimeExports; var _default$h = default_1$h = FilterList.default = (0, _createSvgIcon$h.default)(/* @__PURE__ */ (0, _jsxRuntime$h.jsx)("path", { d: "M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z" }), "FilterList"); @@ -25534,7 +25528,7 @@ Object.defineProperty(FilterListOff, "__esModule", { }); var default_1$g = FilterListOff.default = void 0; var _createSvgIcon$g = _interopRequireDefault$g(requireCreateSvgIcon()); -var _jsxRuntime$g = requireJsxRuntime(); +var _jsxRuntime$g = jsxRuntimeExports; var _default$g = default_1$g = FilterListOff.default = (0, _createSvgIcon$g.default)(/* @__PURE__ */ (0, _jsxRuntime$g.jsx)("path", { d: "M10.83 8H21V6H8.83zm5 5H18v-2h-4.17zM14 16.83V18h-4v-2h3.17l-3-3H6v-2h2.17l-3-3H3V6h.17L1.39 4.22 2.8 2.81l18.38 18.38-1.41 1.41z" }), "FilterListOff"); @@ -25547,7 +25541,7 @@ Object.defineProperty(FirstPage, "__esModule", { }); var default_1$f = FirstPage.default = void 0; var _createSvgIcon$f = _interopRequireDefault$f(requireCreateSvgIcon()); -var _jsxRuntime$f = requireJsxRuntime(); +var _jsxRuntime$f = jsxRuntimeExports; var _default$f = default_1$f = FirstPage.default = (0, _createSvgIcon$f.default)(/* @__PURE__ */ (0, _jsxRuntime$f.jsx)("path", { d: "M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z" }), "FirstPage"); @@ -25560,7 +25554,7 @@ Object.defineProperty(Fullscreen, "__esModule", { }); var default_1$e = Fullscreen.default = void 0; var _createSvgIcon$e = _interopRequireDefault$e(requireCreateSvgIcon()); -var _jsxRuntime$e = requireJsxRuntime(); +var _jsxRuntime$e = jsxRuntimeExports; var _default$e = default_1$e = Fullscreen.default = (0, _createSvgIcon$e.default)(/* @__PURE__ */ (0, _jsxRuntime$e.jsx)("path", { d: "M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z" }), "Fullscreen"); @@ -25573,7 +25567,7 @@ Object.defineProperty(FullscreenExit, "__esModule", { }); var default_1$d = FullscreenExit.default = void 0; var _createSvgIcon$d = _interopRequireDefault$d(requireCreateSvgIcon()); -var _jsxRuntime$d = requireJsxRuntime(); +var _jsxRuntime$d = jsxRuntimeExports; var _default$d = default_1$d = FullscreenExit.default = (0, _createSvgIcon$d.default)(/* @__PURE__ */ (0, _jsxRuntime$d.jsx)("path", { d: "M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z" }), "FullscreenExit"); @@ -25586,7 +25580,7 @@ Object.defineProperty(KeyboardDoubleArrowDown, "__esModule", { }); var default_1$c = KeyboardDoubleArrowDown.default = void 0; var _createSvgIcon$c = _interopRequireDefault$c(requireCreateSvgIcon()); -var _jsxRuntime$c = requireJsxRuntime(); +var _jsxRuntime$c = jsxRuntimeExports; var _default$c = default_1$c = KeyboardDoubleArrowDown.default = (0, _createSvgIcon$c.default)([/* @__PURE__ */ (0, _jsxRuntime$c.jsx)("path", { d: "M18 6.41 16.59 5 12 9.58 7.41 5 6 6.41l6 6z" }, "0"), /* @__PURE__ */ (0, _jsxRuntime$c.jsx)("path", { @@ -25601,7 +25595,7 @@ Object.defineProperty(LastPage, "__esModule", { }); var default_1$b = LastPage.default = void 0; var _createSvgIcon$b = _interopRequireDefault$b(requireCreateSvgIcon()); -var _jsxRuntime$b = requireJsxRuntime(); +var _jsxRuntime$b = jsxRuntimeExports; var _default$b = default_1$b = LastPage.default = (0, _createSvgIcon$b.default)(/* @__PURE__ */ (0, _jsxRuntime$b.jsx)("path", { d: "M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z" }), "LastPage"); @@ -25614,7 +25608,7 @@ Object.defineProperty(MoreHoriz, "__esModule", { }); var default_1$a = MoreHoriz.default = void 0; var _createSvgIcon$a = _interopRequireDefault$a(requireCreateSvgIcon()); -var _jsxRuntime$a = requireJsxRuntime(); +var _jsxRuntime$a = jsxRuntimeExports; var _default$a = default_1$a = MoreHoriz.default = (0, _createSvgIcon$a.default)(/* @__PURE__ */ (0, _jsxRuntime$a.jsx)("path", { d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "MoreHoriz"); @@ -25627,7 +25621,7 @@ Object.defineProperty(MoreVert, "__esModule", { }); var default_1$9 = MoreVert.default = void 0; var _createSvgIcon$9 = _interopRequireDefault$9(requireCreateSvgIcon()); -var _jsxRuntime$9 = requireJsxRuntime(); +var _jsxRuntime$9 = jsxRuntimeExports; var _default$9 = default_1$9 = MoreVert.default = (0, _createSvgIcon$9.default)(/* @__PURE__ */ (0, _jsxRuntime$9.jsx)("path", { d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "MoreVert"); @@ -25640,7 +25634,7 @@ Object.defineProperty(PushPin, "__esModule", { }); var default_1$8 = PushPin.default = void 0; var _createSvgIcon$8 = _interopRequireDefault$8(requireCreateSvgIcon()); -var _jsxRuntime$8 = requireJsxRuntime(); +var _jsxRuntime$8 = jsxRuntimeExports; var _default$8 = default_1$8 = PushPin.default = (0, _createSvgIcon$8.default)(/* @__PURE__ */ (0, _jsxRuntime$8.jsx)("path", { fillRule: "evenodd", d: "M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3" @@ -25654,7 +25648,7 @@ Object.defineProperty(RestartAlt, "__esModule", { }); var default_1$7 = RestartAlt.default = void 0; var _createSvgIcon$7 = _interopRequireDefault$7(requireCreateSvgIcon()); -var _jsxRuntime$7 = requireJsxRuntime(); +var _jsxRuntime$7 = jsxRuntimeExports; var _default$7 = default_1$7 = RestartAlt.default = (0, _createSvgIcon$7.default)(/* @__PURE__ */ (0, _jsxRuntime$7.jsx)("path", { d: "M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91" }), "RestartAlt"); @@ -25667,7 +25661,7 @@ Object.defineProperty(Save, "__esModule", { }); var default_1$6 = Save.default = void 0; var _createSvgIcon$6 = _interopRequireDefault$6(requireCreateSvgIcon()); -var _jsxRuntime$6 = requireJsxRuntime(); +var _jsxRuntime$6 = jsxRuntimeExports; var _default$6 = default_1$6 = Save.default = (0, _createSvgIcon$6.default)(/* @__PURE__ */ (0, _jsxRuntime$6.jsx)("path", { d: "M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z" }), "Save"); @@ -25680,7 +25674,7 @@ Object.defineProperty(Search, "__esModule", { }); var default_1$5 = Search.default = void 0; var _createSvgIcon$5 = _interopRequireDefault$5(requireCreateSvgIcon()); -var _jsxRuntime$5 = requireJsxRuntime(); +var _jsxRuntime$5 = jsxRuntimeExports; var _default$5 = default_1$5 = Search.default = (0, _createSvgIcon$5.default)(/* @__PURE__ */ (0, _jsxRuntime$5.jsx)("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14" }), "Search"); @@ -25693,7 +25687,7 @@ Object.defineProperty(SearchOff, "__esModule", { }); var default_1$4 = SearchOff.default = void 0; var _createSvgIcon$4 = _interopRequireDefault$4(requireCreateSvgIcon()); -var _jsxRuntime$4 = requireJsxRuntime(); +var _jsxRuntime$4 = jsxRuntimeExports; var _default$4 = default_1$4 = SearchOff.default = (0, _createSvgIcon$4.default)([/* @__PURE__ */ (0, _jsxRuntime$4.jsx)("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3 6.08 3 3.28 5.64 3.03 9h2.02C5.3 6.75 7.18 5 9.5 5 11.99 5 14 7.01 14 9.5S11.99 14 9.5 14c-.17 0-.33-.03-.5-.05v2.02c.17.02.33.03.5.03 1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19z" }, "0"), /* @__PURE__ */ (0, _jsxRuntime$4.jsx)("path", { @@ -25708,7 +25702,7 @@ Object.defineProperty(Sort, "__esModule", { }); var default_1$3 = Sort.default = void 0; var _createSvgIcon$3 = _interopRequireDefault$3(requireCreateSvgIcon()); -var _jsxRuntime$3 = requireJsxRuntime(); +var _jsxRuntime$3 = jsxRuntimeExports; var _default$3 = default_1$3 = Sort.default = (0, _createSvgIcon$3.default)(/* @__PURE__ */ (0, _jsxRuntime$3.jsx)("path", { d: "M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z" }), "Sort"); @@ -25721,7 +25715,7 @@ Object.defineProperty(SyncAlt, "__esModule", { }); var default_1$2 = SyncAlt.default = void 0; var _createSvgIcon$2 = _interopRequireDefault$2(requireCreateSvgIcon()); -var _jsxRuntime$2 = requireJsxRuntime(); +var _jsxRuntime$2 = jsxRuntimeExports; var _default$2 = default_1$2 = SyncAlt.default = (0, _createSvgIcon$2.default)(/* @__PURE__ */ (0, _jsxRuntime$2.jsx)("path", { d: "m18 12 4-4-4-4v3H3v2h15zM6 12l-4 4 4 4v-3h15v-2H6z" }), "SyncAlt"); @@ -25734,7 +25728,7 @@ Object.defineProperty(ViewColumn, "__esModule", { }); var default_1$1 = ViewColumn.default = void 0; var _createSvgIcon$1 = _interopRequireDefault$1(requireCreateSvgIcon()); -var _jsxRuntime$1 = requireJsxRuntime(); +var _jsxRuntime$1 = jsxRuntimeExports; var _default$1 = default_1$1 = ViewColumn.default = (0, _createSvgIcon$1.default)(/* @__PURE__ */ (0, _jsxRuntime$1.jsx)("path", { d: "M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z" }), "ViewColumn"); @@ -25747,7 +25741,7 @@ Object.defineProperty(VisibilityOff, "__esModule", { }); var default_1 = VisibilityOff.default = void 0; var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon()); -var _jsxRuntime = requireJsxRuntime(); +var _jsxRuntime = jsxRuntimeExports; var _default = default_1 = VisibilityOff.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", { d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z" }), "VisibilityOff"); @@ -64679,16 +64673,16 @@ const BasicEntityAutocompleteFieldSpecShape = gubu_minExports.Gubu(Open$7({ id: String, name: String, kind: String, - label: gubu_minExports.Default("", String), + label: gubu_minExports.Default(""), options: Open$7({ default: Open$7({}), - label: { field: gubu_minExports.Default("label", String) }, - multiple: gubu_minExports.Default(false, Boolean), + label: { field: gubu_minExports.Default("label") }, + multiple: gubu_minExports.Default(false), ents: Open$7({}) }), ux: Open$7({ - kind: gubu_minExports.Default("Text", String), - edit: gubu_minExports.Default(true, Boolean) + kind: gubu_minExports.Exact("Autocomplete"), + edit: gubu_minExports.Default(true) }) }), errors: Open$7({}) @@ -64712,9 +64706,9 @@ function BasicEntityAutocompleteField(props) { multiple: field.options.multiple, options: resolvedOptions, isOptionEqualToValue: (opt, val) => opt === val || (opt == null ? void 0 : opt.id) != null && (val == null ? void 0 : val.id) != null && opt.id === val.id || (opt == null ? void 0 : opt.value) != null && (val == null ? void 0 : val.value) != null && opt.value === val.value, - getOptionLabel: (option) => option.label, + getOptionLabel: (option) => option[field.options.label.field], value, - onChange: (_2, nweValue) => onChange(nweValue), + onChange: (_2, newVal) => onChange(newVal), renderInput: (params) => /* @__PURE__ */ jsxRuntimeExports.jsx(TextField$1, __spreadProps(__spreadValues({}, params), { label: field.label })) }, field.id diff --git a/dist/voxgig-model-react.umd.js b/dist/voxgig-model-react.umd.js index d3fa045..e267067 100644 --- a/dist/voxgig-model-react.umd.js +++ b/dist/voxgig-model-react.umd.js @@ -1042,21 +1042,15 @@ var __async = (__this, __arguments, generator) => { } return reactJsxRuntime_development; } - var jsxRuntime$1 = jsxRuntime$2.exports; - var hasRequiredJsxRuntime; - function requireJsxRuntime() { - if (hasRequiredJsxRuntime) return jsxRuntime$2.exports; - hasRequiredJsxRuntime = 1; - "use strict"; - if (process.env.NODE_ENV === "production") { - jsxRuntime$2.exports = requireReactJsxRuntime_production_min(); - } else { - jsxRuntime$2.exports = requireReactJsxRuntime_development(); - } - return jsxRuntime$2.exports; + var jsxRuntime = jsxRuntime$2.exports; + "use strict"; + if (process.env.NODE_ENV === "production") { + jsxRuntime$2.exports = requireReactJsxRuntime_production_min(); + } else { + jsxRuntime$2.exports = requireReactJsxRuntime_development(); } - var jsxRuntimeExports = requireJsxRuntime(); - const jsxRuntime = /* @__PURE__ */ getDefaultExportFromCjs(jsxRuntimeExports); + var jsxRuntimeExports = jsxRuntime$2.exports; + const jsxRuntime$1 = /* @__PURE__ */ getDefaultExportFromCjs(jsxRuntimeExports); var gubu_min$2 = { exports: {} }; var gubu_min = gubu_min$2.exports; (function(module2, exports3) { @@ -25323,7 +25317,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$x = ArrowDownward.default = void 0; var _createSvgIcon$x = _interopRequireDefault$x(requireCreateSvgIcon()); - var _jsxRuntime$x = requireJsxRuntime(); + var _jsxRuntime$x = jsxRuntimeExports; var _default$x = default_1$x = ArrowDownward.default = (0, _createSvgIcon$x.default)(/* @__PURE__ */ (0, _jsxRuntime$x.jsx)("path", { d: "m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z" }), "ArrowDownward"); @@ -25336,7 +25330,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$w = ArrowRight.default = void 0; var _createSvgIcon$w = _interopRequireDefault$w(requireCreateSvgIcon()); - var _jsxRuntime$w = requireJsxRuntime(); + var _jsxRuntime$w = jsxRuntimeExports; var _default$w = default_1$w = ArrowRight.default = (0, _createSvgIcon$w.default)(/* @__PURE__ */ (0, _jsxRuntime$w.jsx)("path", { d: "m10 17 5-5-5-5z" }), "ArrowRight"); @@ -25349,7 +25343,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$v = Cancel.default = void 0; var _createSvgIcon$v = _interopRequireDefault$v(requireCreateSvgIcon()); - var _jsxRuntime$v = requireJsxRuntime(); + var _jsxRuntime$v = jsxRuntimeExports; var _default$v = default_1$v = Cancel.default = (0, _createSvgIcon$v.default)(/* @__PURE__ */ (0, _jsxRuntime$v.jsx)("path", { d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z" }), "Cancel"); @@ -25362,7 +25356,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$u = ChevronLeft.default = void 0; var _createSvgIcon$u = _interopRequireDefault$u(requireCreateSvgIcon()); - var _jsxRuntime$u = requireJsxRuntime(); + var _jsxRuntime$u = jsxRuntimeExports; var _default$u = default_1$u = ChevronLeft.default = (0, _createSvgIcon$u.default)(/* @__PURE__ */ (0, _jsxRuntime$u.jsx)("path", { d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z" }), "ChevronLeft"); @@ -25375,7 +25369,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$t = ChevronRight.default = void 0; var _createSvgIcon$t = _interopRequireDefault$t(requireCreateSvgIcon()); - var _jsxRuntime$t = requireJsxRuntime(); + var _jsxRuntime$t = jsxRuntimeExports; var _default$t = default_1$t = ChevronRight.default = (0, _createSvgIcon$t.default)(/* @__PURE__ */ (0, _jsxRuntime$t.jsx)("path", { d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }), "ChevronRight"); @@ -25388,7 +25382,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$s = ClearAll.default = void 0; var _createSvgIcon$s = _interopRequireDefault$s(requireCreateSvgIcon()); - var _jsxRuntime$s = requireJsxRuntime(); + var _jsxRuntime$s = jsxRuntimeExports; var _default$s = default_1$s = ClearAll.default = (0, _createSvgIcon$s.default)(/* @__PURE__ */ (0, _jsxRuntime$s.jsx)("path", { d: "M5 13h14v-2H5zm-2 4h14v-2H3zM7 7v2h14V7z" }), "ClearAll"); @@ -25401,7 +25395,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$r = Close.default = void 0; var _createSvgIcon$r = _interopRequireDefault$r(requireCreateSvgIcon()); - var _jsxRuntime$r = requireJsxRuntime(); + var _jsxRuntime$r = jsxRuntimeExports; var _default$r = default_1$r = Close.default = (0, _createSvgIcon$r.default)(/* @__PURE__ */ (0, _jsxRuntime$r.jsx)("path", { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }), "Close"); @@ -25414,7 +25408,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$q = ContentCopy.default = void 0; var _createSvgIcon$q = _interopRequireDefault$q(requireCreateSvgIcon()); - var _jsxRuntime$q = requireJsxRuntime(); + var _jsxRuntime$q = jsxRuntimeExports; var _default$q = default_1$q = ContentCopy.default = (0, _createSvgIcon$q.default)(/* @__PURE__ */ (0, _jsxRuntime$q.jsx)("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z" }), "ContentCopy"); @@ -25427,7 +25421,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$p = DensityLarge.default = void 0; var _createSvgIcon$p = _interopRequireDefault$p(requireCreateSvgIcon()); - var _jsxRuntime$p = requireJsxRuntime(); + var _jsxRuntime$p = jsxRuntimeExports; var _default$p = default_1$p = DensityLarge.default = (0, _createSvgIcon$p.default)(/* @__PURE__ */ (0, _jsxRuntime$p.jsx)("path", { d: "M3 3h18v2H3zm0 16h18v2H3z" }), "DensityLarge"); @@ -25440,7 +25434,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$o = DensityMedium.default = void 0; var _createSvgIcon$o = _interopRequireDefault$o(requireCreateSvgIcon()); - var _jsxRuntime$o = requireJsxRuntime(); + var _jsxRuntime$o = jsxRuntimeExports; var _default$o = default_1$o = DensityMedium.default = (0, _createSvgIcon$o.default)(/* @__PURE__ */ (0, _jsxRuntime$o.jsx)("path", { d: "M3 3h18v2H3zm0 16h18v2H3zm0-8h18v2H3z" }), "DensityMedium"); @@ -25453,7 +25447,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$n = DensitySmall.default = void 0; var _createSvgIcon$n = _interopRequireDefault$n(requireCreateSvgIcon()); - var _jsxRuntime$n = requireJsxRuntime(); + var _jsxRuntime$n = jsxRuntimeExports; var _default$n = default_1$n = DensitySmall.default = (0, _createSvgIcon$n.default)(/* @__PURE__ */ (0, _jsxRuntime$n.jsx)("path", { d: "M3 2h18v2H3zm0 18h18v2H3zm0-6h18v2H3zm0-6h18v2H3z" }), "DensitySmall"); @@ -25466,7 +25460,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$m = DragHandle.default = void 0; var _createSvgIcon$m = _interopRequireDefault$m(requireCreateSvgIcon()); - var _jsxRuntime$m = requireJsxRuntime(); + var _jsxRuntime$m = jsxRuntimeExports; var _default$m = default_1$m = DragHandle.default = (0, _createSvgIcon$m.default)(/* @__PURE__ */ (0, _jsxRuntime$m.jsx)("path", { d: "M20 9H4v2h16zM4 15h16v-2H4z" }), "DragHandle"); @@ -25479,7 +25473,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$l = DynamicFeed.default = void 0; var _createSvgIcon$l = _interopRequireDefault$l(requireCreateSvgIcon()); - var _jsxRuntime$l = requireJsxRuntime(); + var _jsxRuntime$l = jsxRuntimeExports; var _default$l = default_1$l = DynamicFeed.default = (0, _createSvgIcon$l.default)([/* @__PURE__ */ (0, _jsxRuntime$l.jsx)("path", { d: "M8 8H6v7c0 1.1.9 2 2 2h9v-2H8z" }, "0"), /* @__PURE__ */ (0, _jsxRuntime$l.jsx)("path", { @@ -25494,7 +25488,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$k = Edit.default = void 0; var _createSvgIcon$k = _interopRequireDefault$k(requireCreateSvgIcon()); - var _jsxRuntime$k = requireJsxRuntime(); + var _jsxRuntime$k = jsxRuntimeExports; var _default$k = default_1$k = Edit.default = (0, _createSvgIcon$k.default)(/* @__PURE__ */ (0, _jsxRuntime$k.jsx)("path", { d: "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z" }), "Edit"); @@ -25507,7 +25501,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$j = ExpandMore.default = void 0; var _createSvgIcon$j = _interopRequireDefault$j(requireCreateSvgIcon()); - var _jsxRuntime$j = requireJsxRuntime(); + var _jsxRuntime$j = jsxRuntimeExports; var _default$j = default_1$j = ExpandMore.default = (0, _createSvgIcon$j.default)(/* @__PURE__ */ (0, _jsxRuntime$j.jsx)("path", { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }), "ExpandMore"); @@ -25520,7 +25514,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$i = FilterAlt.default = void 0; var _createSvgIcon$i = _interopRequireDefault$i(requireCreateSvgIcon()); - var _jsxRuntime$i = requireJsxRuntime(); + var _jsxRuntime$i = jsxRuntimeExports; var _default$i = default_1$i = FilterAlt.default = (0, _createSvgIcon$i.default)(/* @__PURE__ */ (0, _jsxRuntime$i.jsx)("path", { d: "M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61" }), "FilterAlt"); @@ -25533,7 +25527,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$h = FilterList.default = void 0; var _createSvgIcon$h = _interopRequireDefault$h(requireCreateSvgIcon()); - var _jsxRuntime$h = requireJsxRuntime(); + var _jsxRuntime$h = jsxRuntimeExports; var _default$h = default_1$h = FilterList.default = (0, _createSvgIcon$h.default)(/* @__PURE__ */ (0, _jsxRuntime$h.jsx)("path", { d: "M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z" }), "FilterList"); @@ -25546,7 +25540,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$g = FilterListOff.default = void 0; var _createSvgIcon$g = _interopRequireDefault$g(requireCreateSvgIcon()); - var _jsxRuntime$g = requireJsxRuntime(); + var _jsxRuntime$g = jsxRuntimeExports; var _default$g = default_1$g = FilterListOff.default = (0, _createSvgIcon$g.default)(/* @__PURE__ */ (0, _jsxRuntime$g.jsx)("path", { d: "M10.83 8H21V6H8.83zm5 5H18v-2h-4.17zM14 16.83V18h-4v-2h3.17l-3-3H6v-2h2.17l-3-3H3V6h.17L1.39 4.22 2.8 2.81l18.38 18.38-1.41 1.41z" }), "FilterListOff"); @@ -25559,7 +25553,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$f = FirstPage.default = void 0; var _createSvgIcon$f = _interopRequireDefault$f(requireCreateSvgIcon()); - var _jsxRuntime$f = requireJsxRuntime(); + var _jsxRuntime$f = jsxRuntimeExports; var _default$f = default_1$f = FirstPage.default = (0, _createSvgIcon$f.default)(/* @__PURE__ */ (0, _jsxRuntime$f.jsx)("path", { d: "M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z" }), "FirstPage"); @@ -25572,7 +25566,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$e = Fullscreen.default = void 0; var _createSvgIcon$e = _interopRequireDefault$e(requireCreateSvgIcon()); - var _jsxRuntime$e = requireJsxRuntime(); + var _jsxRuntime$e = jsxRuntimeExports; var _default$e = default_1$e = Fullscreen.default = (0, _createSvgIcon$e.default)(/* @__PURE__ */ (0, _jsxRuntime$e.jsx)("path", { d: "M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z" }), "Fullscreen"); @@ -25585,7 +25579,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$d = FullscreenExit.default = void 0; var _createSvgIcon$d = _interopRequireDefault$d(requireCreateSvgIcon()); - var _jsxRuntime$d = requireJsxRuntime(); + var _jsxRuntime$d = jsxRuntimeExports; var _default$d = default_1$d = FullscreenExit.default = (0, _createSvgIcon$d.default)(/* @__PURE__ */ (0, _jsxRuntime$d.jsx)("path", { d: "M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z" }), "FullscreenExit"); @@ -25598,7 +25592,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$c = KeyboardDoubleArrowDown.default = void 0; var _createSvgIcon$c = _interopRequireDefault$c(requireCreateSvgIcon()); - var _jsxRuntime$c = requireJsxRuntime(); + var _jsxRuntime$c = jsxRuntimeExports; var _default$c = default_1$c = KeyboardDoubleArrowDown.default = (0, _createSvgIcon$c.default)([/* @__PURE__ */ (0, _jsxRuntime$c.jsx)("path", { d: "M18 6.41 16.59 5 12 9.58 7.41 5 6 6.41l6 6z" }, "0"), /* @__PURE__ */ (0, _jsxRuntime$c.jsx)("path", { @@ -25613,7 +25607,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$b = LastPage.default = void 0; var _createSvgIcon$b = _interopRequireDefault$b(requireCreateSvgIcon()); - var _jsxRuntime$b = requireJsxRuntime(); + var _jsxRuntime$b = jsxRuntimeExports; var _default$b = default_1$b = LastPage.default = (0, _createSvgIcon$b.default)(/* @__PURE__ */ (0, _jsxRuntime$b.jsx)("path", { d: "M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z" }), "LastPage"); @@ -25626,7 +25620,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$a = MoreHoriz.default = void 0; var _createSvgIcon$a = _interopRequireDefault$a(requireCreateSvgIcon()); - var _jsxRuntime$a = requireJsxRuntime(); + var _jsxRuntime$a = jsxRuntimeExports; var _default$a = default_1$a = MoreHoriz.default = (0, _createSvgIcon$a.default)(/* @__PURE__ */ (0, _jsxRuntime$a.jsx)("path", { d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "MoreHoriz"); @@ -25639,7 +25633,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$9 = MoreVert.default = void 0; var _createSvgIcon$9 = _interopRequireDefault$9(requireCreateSvgIcon()); - var _jsxRuntime$9 = requireJsxRuntime(); + var _jsxRuntime$9 = jsxRuntimeExports; var _default$9 = default_1$9 = MoreVert.default = (0, _createSvgIcon$9.default)(/* @__PURE__ */ (0, _jsxRuntime$9.jsx)("path", { d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "MoreVert"); @@ -25652,7 +25646,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$8 = PushPin.default = void 0; var _createSvgIcon$8 = _interopRequireDefault$8(requireCreateSvgIcon()); - var _jsxRuntime$8 = requireJsxRuntime(); + var _jsxRuntime$8 = jsxRuntimeExports; var _default$8 = default_1$8 = PushPin.default = (0, _createSvgIcon$8.default)(/* @__PURE__ */ (0, _jsxRuntime$8.jsx)("path", { fillRule: "evenodd", d: "M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3" @@ -25666,7 +25660,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$7 = RestartAlt.default = void 0; var _createSvgIcon$7 = _interopRequireDefault$7(requireCreateSvgIcon()); - var _jsxRuntime$7 = requireJsxRuntime(); + var _jsxRuntime$7 = jsxRuntimeExports; var _default$7 = default_1$7 = RestartAlt.default = (0, _createSvgIcon$7.default)(/* @__PURE__ */ (0, _jsxRuntime$7.jsx)("path", { d: "M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91" }), "RestartAlt"); @@ -25679,7 +25673,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$6 = Save.default = void 0; var _createSvgIcon$6 = _interopRequireDefault$6(requireCreateSvgIcon()); - var _jsxRuntime$6 = requireJsxRuntime(); + var _jsxRuntime$6 = jsxRuntimeExports; var _default$6 = default_1$6 = Save.default = (0, _createSvgIcon$6.default)(/* @__PURE__ */ (0, _jsxRuntime$6.jsx)("path", { d: "M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z" }), "Save"); @@ -25692,7 +25686,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$5 = Search.default = void 0; var _createSvgIcon$5 = _interopRequireDefault$5(requireCreateSvgIcon()); - var _jsxRuntime$5 = requireJsxRuntime(); + var _jsxRuntime$5 = jsxRuntimeExports; var _default$5 = default_1$5 = Search.default = (0, _createSvgIcon$5.default)(/* @__PURE__ */ (0, _jsxRuntime$5.jsx)("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14" }), "Search"); @@ -25705,7 +25699,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$4 = SearchOff.default = void 0; var _createSvgIcon$4 = _interopRequireDefault$4(requireCreateSvgIcon()); - var _jsxRuntime$4 = requireJsxRuntime(); + var _jsxRuntime$4 = jsxRuntimeExports; var _default$4 = default_1$4 = SearchOff.default = (0, _createSvgIcon$4.default)([/* @__PURE__ */ (0, _jsxRuntime$4.jsx)("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3 6.08 3 3.28 5.64 3.03 9h2.02C5.3 6.75 7.18 5 9.5 5 11.99 5 14 7.01 14 9.5S11.99 14 9.5 14c-.17 0-.33-.03-.5-.05v2.02c.17.02.33.03.5.03 1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19z" }, "0"), /* @__PURE__ */ (0, _jsxRuntime$4.jsx)("path", { @@ -25720,7 +25714,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$3 = Sort.default = void 0; var _createSvgIcon$3 = _interopRequireDefault$3(requireCreateSvgIcon()); - var _jsxRuntime$3 = requireJsxRuntime(); + var _jsxRuntime$3 = jsxRuntimeExports; var _default$3 = default_1$3 = Sort.default = (0, _createSvgIcon$3.default)(/* @__PURE__ */ (0, _jsxRuntime$3.jsx)("path", { d: "M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z" }), "Sort"); @@ -25733,7 +25727,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$2 = SyncAlt.default = void 0; var _createSvgIcon$2 = _interopRequireDefault$2(requireCreateSvgIcon()); - var _jsxRuntime$2 = requireJsxRuntime(); + var _jsxRuntime$2 = jsxRuntimeExports; var _default$2 = default_1$2 = SyncAlt.default = (0, _createSvgIcon$2.default)(/* @__PURE__ */ (0, _jsxRuntime$2.jsx)("path", { d: "m18 12 4-4-4-4v3H3v2h15zM6 12l-4 4 4 4v-3h15v-2H6z" }), "SyncAlt"); @@ -25746,7 +25740,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$1 = ViewColumn.default = void 0; var _createSvgIcon$1 = _interopRequireDefault$1(requireCreateSvgIcon()); - var _jsxRuntime$1 = requireJsxRuntime(); + var _jsxRuntime$1 = jsxRuntimeExports; var _default$1 = default_1$1 = ViewColumn.default = (0, _createSvgIcon$1.default)(/* @__PURE__ */ (0, _jsxRuntime$1.jsx)("path", { d: "M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z" }), "ViewColumn"); @@ -25759,7 +25753,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1 = VisibilityOff.default = void 0; var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon()); - var _jsxRuntime = requireJsxRuntime(); + var _jsxRuntime = jsxRuntimeExports; var _default = default_1 = VisibilityOff.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", { d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z" }), "VisibilityOff"); @@ -64691,16 +64685,16 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha id: String, name: String, kind: String, - label: gubu_minExports.Default("", String), + label: gubu_minExports.Default(""), options: Open$7({ default: Open$7({}), - label: { field: gubu_minExports.Default("label", String) }, - multiple: gubu_minExports.Default(false, Boolean), + label: { field: gubu_minExports.Default("label") }, + multiple: gubu_minExports.Default(false), ents: Open$7({}) }), ux: Open$7({ - kind: gubu_minExports.Default("Text", String), - edit: gubu_minExports.Default(true, Boolean) + kind: gubu_minExports.Exact("Autocomplete"), + edit: gubu_minExports.Default(true) }) }), errors: Open$7({}) @@ -64724,9 +64718,9 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha multiple: field.options.multiple, options: resolvedOptions, isOptionEqualToValue: (opt, val) => opt === val || (opt == null ? void 0 : opt.id) != null && (val == null ? void 0 : val.id) != null && opt.id === val.id || (opt == null ? void 0 : opt.value) != null && (val == null ? void 0 : val.value) != null && opt.value === val.value, - getOptionLabel: (option) => option.label, + getOptionLabel: (option) => option[field.options.label.field], value, - onChange: (_2, nweValue) => onChange(nweValue), + onChange: (_2, newVal) => onChange(newVal), renderInput: (params) => /* @__PURE__ */ jsxRuntimeExports.jsx(material.TextField, __spreadProps(__spreadValues({}, params), { label: field.label })) }, field.id diff --git a/src/lib/BasicEntityAutocompleteField.tsx b/src/lib/BasicEntityAutocompleteField.tsx index d257600..558d072 100644 --- a/src/lib/BasicEntityAutocompleteField.tsx +++ b/src/lib/BasicEntityAutocompleteField.tsx @@ -55,9 +55,9 @@ function BasicEntityAutocompleteField(props: any) { (opt?.id != null && val?.id != null && opt.id === val.id) || (opt?.value != null && val?.value != null && opt.value === val.value) } - getOptionLabel={(option: any) => option.label} + getOptionLabel={(option: any) => option[field.options.label.field]} value={value} - onChange={(_, nweValue: any) => onChange(nweValue)} + onChange={(_, newVal: any) => onChange(newVal)} renderInput={(params: any) => } /> )} From 13bdb3ef0ff00abcfa462baca476f50d56670418 Mon Sep 17 00:00:00 2001 From: Zack Braksa Date: Thu, 25 Jul 2024 19:08:24 +0100 Subject: [PATCH 09/12] Add key prop to Controller cmp --- src/lib/BasicEntityAutocompleteField.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/BasicEntityAutocompleteField.tsx b/src/lib/BasicEntityAutocompleteField.tsx index 558d072..66a4876 100644 --- a/src/lib/BasicEntityAutocompleteField.tsx +++ b/src/lib/BasicEntityAutocompleteField.tsx @@ -40,6 +40,7 @@ function BasicEntityAutocompleteField(props: any) { return ( Date: Thu, 25 Jul 2024 19:12:25 +0100 Subject: [PATCH 10/12] Refactor BasicEntityAutocompleteField component --- src/lib/BasicEntityAutocompleteField.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/BasicEntityAutocompleteField.tsx b/src/lib/BasicEntityAutocompleteField.tsx index 66a4876..61a8ed1 100644 --- a/src/lib/BasicEntityAutocompleteField.tsx +++ b/src/lib/BasicEntityAutocompleteField.tsx @@ -40,13 +40,12 @@ function BasicEntityAutocompleteField(props: any) { return ( ( Date: Thu, 25 Jul 2024 19:37:18 +0100 Subject: [PATCH 11/12] Remove unnecessary prop in Gubu shape --- dist/voxgig-model-react.es.js | 9 ++++----- dist/voxgig-model-react.umd.js | 9 ++++----- src/lib/BasicEntityAutocompleteField.tsx | 3 +-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/dist/voxgig-model-react.es.js b/dist/voxgig-model-react.es.js index 4c7817d..07dd080 100644 --- a/dist/voxgig-model-react.es.js +++ b/dist/voxgig-model-react.es.js @@ -64684,8 +64684,7 @@ const BasicEntityAutocompleteFieldSpecShape = gubu_minExports.Gubu(Open$7({ kind: gubu_minExports.Exact("Autocomplete"), edit: gubu_minExports.Default(true) }) - }), - errors: Open$7({}) + }) }), { name: CMPNAME$9 }); function BasicEntityAutocompleteField(props) { const { spec } = props; @@ -64710,10 +64709,10 @@ function BasicEntityAutocompleteField(props) { value, onChange: (_2, newVal) => onChange(newVal), renderInput: (params) => /* @__PURE__ */ jsxRuntimeExports.jsx(TextField$1, __spreadProps(__spreadValues({}, params), { label: field.label })) - }, - field.id + } ) - } + }, + `${field.id}-controller` ); } function resolveOptions(options) { diff --git a/dist/voxgig-model-react.umd.js b/dist/voxgig-model-react.umd.js index e267067..ffb79bd 100644 --- a/dist/voxgig-model-react.umd.js +++ b/dist/voxgig-model-react.umd.js @@ -64696,8 +64696,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha kind: gubu_minExports.Exact("Autocomplete"), edit: gubu_minExports.Default(true) }) - }), - errors: Open$7({}) + }) }), { name: CMPNAME$9 }); function BasicEntityAutocompleteField(props) { const { spec } = props; @@ -64722,10 +64721,10 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha value, onChange: (_2, newVal) => onChange(newVal), renderInput: (params) => /* @__PURE__ */ jsxRuntimeExports.jsx(material.TextField, __spreadProps(__spreadValues({}, params), { label: field.label })) - }, - field.id + } ) - } + }, + `${field.id}-controller` ); } function resolveOptions(options) { diff --git a/src/lib/BasicEntityAutocompleteField.tsx b/src/lib/BasicEntityAutocompleteField.tsx index 61a8ed1..bd42836 100644 --- a/src/lib/BasicEntityAutocompleteField.tsx +++ b/src/lib/BasicEntityAutocompleteField.tsx @@ -25,8 +25,7 @@ const BasicEntityAutocompleteFieldSpecShape = Gubu(Open({ kind: Exact('Autocomplete'), edit: Default(true), }) - }), - errors: Open({}), + }) }), {name: CMPNAME}) function BasicEntityAutocompleteField(props: any) { From 865cb9b1117f31a57188b00cfb3d5a7297132448 Mon Sep 17 00:00:00 2001 From: Zack Braksa Date: Thu, 25 Jul 2024 20:45:49 +0100 Subject: [PATCH 12/12] Refactor BasicEntityAutocompleteField component --- dist/voxgig-model-react.es.js | 145 +++++++++++++++-------- dist/voxgig-model-react.umd.js | 145 +++++++++++++++-------- src/lib/BasicEntityAutocompleteField.tsx | 60 +++++++--- 3 files changed, 228 insertions(+), 122 deletions(-) diff --git a/dist/voxgig-model-react.es.js b/dist/voxgig-model-react.es.js index 07dd080..9c06fac 100644 --- a/dist/voxgig-model-react.es.js +++ b/dist/voxgig-model-react.es.js @@ -1030,15 +1030,21 @@ function requireReactJsxRuntime_development() { } return reactJsxRuntime_development; } -var jsxRuntime = jsxRuntime$2.exports; -"use strict"; -if (process.env.NODE_ENV === "production") { - jsxRuntime$2.exports = requireReactJsxRuntime_production_min(); -} else { - jsxRuntime$2.exports = requireReactJsxRuntime_development(); +var jsxRuntime$1 = jsxRuntime$2.exports; +var hasRequiredJsxRuntime; +function requireJsxRuntime() { + if (hasRequiredJsxRuntime) return jsxRuntime$2.exports; + hasRequiredJsxRuntime = 1; + "use strict"; + if (process.env.NODE_ENV === "production") { + jsxRuntime$2.exports = requireReactJsxRuntime_production_min(); + } else { + jsxRuntime$2.exports = requireReactJsxRuntime_development(); + } + return jsxRuntime$2.exports; } -var jsxRuntimeExports = jsxRuntime$2.exports; -const jsxRuntime$1 = /* @__PURE__ */ getDefaultExportFromCjs(jsxRuntimeExports); +var jsxRuntimeExports = requireJsxRuntime(); +const jsxRuntime = /* @__PURE__ */ getDefaultExportFromCjs(jsxRuntimeExports); var gubu_min$2 = { exports: {} }; var gubu_min = gubu_min$2.exports; (function(module, exports) { @@ -25305,7 +25311,7 @@ Object.defineProperty(ArrowDownward, "__esModule", { }); var default_1$x = ArrowDownward.default = void 0; var _createSvgIcon$x = _interopRequireDefault$x(requireCreateSvgIcon()); -var _jsxRuntime$x = jsxRuntimeExports; +var _jsxRuntime$x = requireJsxRuntime(); var _default$x = default_1$x = ArrowDownward.default = (0, _createSvgIcon$x.default)(/* @__PURE__ */ (0, _jsxRuntime$x.jsx)("path", { d: "m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z" }), "ArrowDownward"); @@ -25318,7 +25324,7 @@ Object.defineProperty(ArrowRight, "__esModule", { }); var default_1$w = ArrowRight.default = void 0; var _createSvgIcon$w = _interopRequireDefault$w(requireCreateSvgIcon()); -var _jsxRuntime$w = jsxRuntimeExports; +var _jsxRuntime$w = requireJsxRuntime(); var _default$w = default_1$w = ArrowRight.default = (0, _createSvgIcon$w.default)(/* @__PURE__ */ (0, _jsxRuntime$w.jsx)("path", { d: "m10 17 5-5-5-5z" }), "ArrowRight"); @@ -25331,7 +25337,7 @@ Object.defineProperty(Cancel, "__esModule", { }); var default_1$v = Cancel.default = void 0; var _createSvgIcon$v = _interopRequireDefault$v(requireCreateSvgIcon()); -var _jsxRuntime$v = jsxRuntimeExports; +var _jsxRuntime$v = requireJsxRuntime(); var _default$v = default_1$v = Cancel.default = (0, _createSvgIcon$v.default)(/* @__PURE__ */ (0, _jsxRuntime$v.jsx)("path", { d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z" }), "Cancel"); @@ -25344,7 +25350,7 @@ Object.defineProperty(ChevronLeft, "__esModule", { }); var default_1$u = ChevronLeft.default = void 0; var _createSvgIcon$u = _interopRequireDefault$u(requireCreateSvgIcon()); -var _jsxRuntime$u = jsxRuntimeExports; +var _jsxRuntime$u = requireJsxRuntime(); var _default$u = default_1$u = ChevronLeft.default = (0, _createSvgIcon$u.default)(/* @__PURE__ */ (0, _jsxRuntime$u.jsx)("path", { d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z" }), "ChevronLeft"); @@ -25357,7 +25363,7 @@ Object.defineProperty(ChevronRight, "__esModule", { }); var default_1$t = ChevronRight.default = void 0; var _createSvgIcon$t = _interopRequireDefault$t(requireCreateSvgIcon()); -var _jsxRuntime$t = jsxRuntimeExports; +var _jsxRuntime$t = requireJsxRuntime(); var _default$t = default_1$t = ChevronRight.default = (0, _createSvgIcon$t.default)(/* @__PURE__ */ (0, _jsxRuntime$t.jsx)("path", { d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }), "ChevronRight"); @@ -25370,7 +25376,7 @@ Object.defineProperty(ClearAll, "__esModule", { }); var default_1$s = ClearAll.default = void 0; var _createSvgIcon$s = _interopRequireDefault$s(requireCreateSvgIcon()); -var _jsxRuntime$s = jsxRuntimeExports; +var _jsxRuntime$s = requireJsxRuntime(); var _default$s = default_1$s = ClearAll.default = (0, _createSvgIcon$s.default)(/* @__PURE__ */ (0, _jsxRuntime$s.jsx)("path", { d: "M5 13h14v-2H5zm-2 4h14v-2H3zM7 7v2h14V7z" }), "ClearAll"); @@ -25383,7 +25389,7 @@ Object.defineProperty(Close, "__esModule", { }); var default_1$r = Close.default = void 0; var _createSvgIcon$r = _interopRequireDefault$r(requireCreateSvgIcon()); -var _jsxRuntime$r = jsxRuntimeExports; +var _jsxRuntime$r = requireJsxRuntime(); var _default$r = default_1$r = Close.default = (0, _createSvgIcon$r.default)(/* @__PURE__ */ (0, _jsxRuntime$r.jsx)("path", { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }), "Close"); @@ -25396,7 +25402,7 @@ Object.defineProperty(ContentCopy, "__esModule", { }); var default_1$q = ContentCopy.default = void 0; var _createSvgIcon$q = _interopRequireDefault$q(requireCreateSvgIcon()); -var _jsxRuntime$q = jsxRuntimeExports; +var _jsxRuntime$q = requireJsxRuntime(); var _default$q = default_1$q = ContentCopy.default = (0, _createSvgIcon$q.default)(/* @__PURE__ */ (0, _jsxRuntime$q.jsx)("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z" }), "ContentCopy"); @@ -25409,7 +25415,7 @@ Object.defineProperty(DensityLarge, "__esModule", { }); var default_1$p = DensityLarge.default = void 0; var _createSvgIcon$p = _interopRequireDefault$p(requireCreateSvgIcon()); -var _jsxRuntime$p = jsxRuntimeExports; +var _jsxRuntime$p = requireJsxRuntime(); var _default$p = default_1$p = DensityLarge.default = (0, _createSvgIcon$p.default)(/* @__PURE__ */ (0, _jsxRuntime$p.jsx)("path", { d: "M3 3h18v2H3zm0 16h18v2H3z" }), "DensityLarge"); @@ -25422,7 +25428,7 @@ Object.defineProperty(DensityMedium, "__esModule", { }); var default_1$o = DensityMedium.default = void 0; var _createSvgIcon$o = _interopRequireDefault$o(requireCreateSvgIcon()); -var _jsxRuntime$o = jsxRuntimeExports; +var _jsxRuntime$o = requireJsxRuntime(); var _default$o = default_1$o = DensityMedium.default = (0, _createSvgIcon$o.default)(/* @__PURE__ */ (0, _jsxRuntime$o.jsx)("path", { d: "M3 3h18v2H3zm0 16h18v2H3zm0-8h18v2H3z" }), "DensityMedium"); @@ -25435,7 +25441,7 @@ Object.defineProperty(DensitySmall, "__esModule", { }); var default_1$n = DensitySmall.default = void 0; var _createSvgIcon$n = _interopRequireDefault$n(requireCreateSvgIcon()); -var _jsxRuntime$n = jsxRuntimeExports; +var _jsxRuntime$n = requireJsxRuntime(); var _default$n = default_1$n = DensitySmall.default = (0, _createSvgIcon$n.default)(/* @__PURE__ */ (0, _jsxRuntime$n.jsx)("path", { d: "M3 2h18v2H3zm0 18h18v2H3zm0-6h18v2H3zm0-6h18v2H3z" }), "DensitySmall"); @@ -25448,7 +25454,7 @@ Object.defineProperty(DragHandle, "__esModule", { }); var default_1$m = DragHandle.default = void 0; var _createSvgIcon$m = _interopRequireDefault$m(requireCreateSvgIcon()); -var _jsxRuntime$m = jsxRuntimeExports; +var _jsxRuntime$m = requireJsxRuntime(); var _default$m = default_1$m = DragHandle.default = (0, _createSvgIcon$m.default)(/* @__PURE__ */ (0, _jsxRuntime$m.jsx)("path", { d: "M20 9H4v2h16zM4 15h16v-2H4z" }), "DragHandle"); @@ -25461,7 +25467,7 @@ Object.defineProperty(DynamicFeed, "__esModule", { }); var default_1$l = DynamicFeed.default = void 0; var _createSvgIcon$l = _interopRequireDefault$l(requireCreateSvgIcon()); -var _jsxRuntime$l = jsxRuntimeExports; +var _jsxRuntime$l = requireJsxRuntime(); var _default$l = default_1$l = DynamicFeed.default = (0, _createSvgIcon$l.default)([/* @__PURE__ */ (0, _jsxRuntime$l.jsx)("path", { d: "M8 8H6v7c0 1.1.9 2 2 2h9v-2H8z" }, "0"), /* @__PURE__ */ (0, _jsxRuntime$l.jsx)("path", { @@ -25476,7 +25482,7 @@ Object.defineProperty(Edit, "__esModule", { }); var default_1$k = Edit.default = void 0; var _createSvgIcon$k = _interopRequireDefault$k(requireCreateSvgIcon()); -var _jsxRuntime$k = jsxRuntimeExports; +var _jsxRuntime$k = requireJsxRuntime(); var _default$k = default_1$k = Edit.default = (0, _createSvgIcon$k.default)(/* @__PURE__ */ (0, _jsxRuntime$k.jsx)("path", { d: "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z" }), "Edit"); @@ -25489,7 +25495,7 @@ Object.defineProperty(ExpandMore, "__esModule", { }); var default_1$j = ExpandMore.default = void 0; var _createSvgIcon$j = _interopRequireDefault$j(requireCreateSvgIcon()); -var _jsxRuntime$j = jsxRuntimeExports; +var _jsxRuntime$j = requireJsxRuntime(); var _default$j = default_1$j = ExpandMore.default = (0, _createSvgIcon$j.default)(/* @__PURE__ */ (0, _jsxRuntime$j.jsx)("path", { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }), "ExpandMore"); @@ -25502,7 +25508,7 @@ Object.defineProperty(FilterAlt, "__esModule", { }); var default_1$i = FilterAlt.default = void 0; var _createSvgIcon$i = _interopRequireDefault$i(requireCreateSvgIcon()); -var _jsxRuntime$i = jsxRuntimeExports; +var _jsxRuntime$i = requireJsxRuntime(); var _default$i = default_1$i = FilterAlt.default = (0, _createSvgIcon$i.default)(/* @__PURE__ */ (0, _jsxRuntime$i.jsx)("path", { d: "M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61" }), "FilterAlt"); @@ -25515,7 +25521,7 @@ Object.defineProperty(FilterList, "__esModule", { }); var default_1$h = FilterList.default = void 0; var _createSvgIcon$h = _interopRequireDefault$h(requireCreateSvgIcon()); -var _jsxRuntime$h = jsxRuntimeExports; +var _jsxRuntime$h = requireJsxRuntime(); var _default$h = default_1$h = FilterList.default = (0, _createSvgIcon$h.default)(/* @__PURE__ */ (0, _jsxRuntime$h.jsx)("path", { d: "M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z" }), "FilterList"); @@ -25528,7 +25534,7 @@ Object.defineProperty(FilterListOff, "__esModule", { }); var default_1$g = FilterListOff.default = void 0; var _createSvgIcon$g = _interopRequireDefault$g(requireCreateSvgIcon()); -var _jsxRuntime$g = jsxRuntimeExports; +var _jsxRuntime$g = requireJsxRuntime(); var _default$g = default_1$g = FilterListOff.default = (0, _createSvgIcon$g.default)(/* @__PURE__ */ (0, _jsxRuntime$g.jsx)("path", { d: "M10.83 8H21V6H8.83zm5 5H18v-2h-4.17zM14 16.83V18h-4v-2h3.17l-3-3H6v-2h2.17l-3-3H3V6h.17L1.39 4.22 2.8 2.81l18.38 18.38-1.41 1.41z" }), "FilterListOff"); @@ -25541,7 +25547,7 @@ Object.defineProperty(FirstPage, "__esModule", { }); var default_1$f = FirstPage.default = void 0; var _createSvgIcon$f = _interopRequireDefault$f(requireCreateSvgIcon()); -var _jsxRuntime$f = jsxRuntimeExports; +var _jsxRuntime$f = requireJsxRuntime(); var _default$f = default_1$f = FirstPage.default = (0, _createSvgIcon$f.default)(/* @__PURE__ */ (0, _jsxRuntime$f.jsx)("path", { d: "M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z" }), "FirstPage"); @@ -25554,7 +25560,7 @@ Object.defineProperty(Fullscreen, "__esModule", { }); var default_1$e = Fullscreen.default = void 0; var _createSvgIcon$e = _interopRequireDefault$e(requireCreateSvgIcon()); -var _jsxRuntime$e = jsxRuntimeExports; +var _jsxRuntime$e = requireJsxRuntime(); var _default$e = default_1$e = Fullscreen.default = (0, _createSvgIcon$e.default)(/* @__PURE__ */ (0, _jsxRuntime$e.jsx)("path", { d: "M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z" }), "Fullscreen"); @@ -25567,7 +25573,7 @@ Object.defineProperty(FullscreenExit, "__esModule", { }); var default_1$d = FullscreenExit.default = void 0; var _createSvgIcon$d = _interopRequireDefault$d(requireCreateSvgIcon()); -var _jsxRuntime$d = jsxRuntimeExports; +var _jsxRuntime$d = requireJsxRuntime(); var _default$d = default_1$d = FullscreenExit.default = (0, _createSvgIcon$d.default)(/* @__PURE__ */ (0, _jsxRuntime$d.jsx)("path", { d: "M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z" }), "FullscreenExit"); @@ -25580,7 +25586,7 @@ Object.defineProperty(KeyboardDoubleArrowDown, "__esModule", { }); var default_1$c = KeyboardDoubleArrowDown.default = void 0; var _createSvgIcon$c = _interopRequireDefault$c(requireCreateSvgIcon()); -var _jsxRuntime$c = jsxRuntimeExports; +var _jsxRuntime$c = requireJsxRuntime(); var _default$c = default_1$c = KeyboardDoubleArrowDown.default = (0, _createSvgIcon$c.default)([/* @__PURE__ */ (0, _jsxRuntime$c.jsx)("path", { d: "M18 6.41 16.59 5 12 9.58 7.41 5 6 6.41l6 6z" }, "0"), /* @__PURE__ */ (0, _jsxRuntime$c.jsx)("path", { @@ -25595,7 +25601,7 @@ Object.defineProperty(LastPage, "__esModule", { }); var default_1$b = LastPage.default = void 0; var _createSvgIcon$b = _interopRequireDefault$b(requireCreateSvgIcon()); -var _jsxRuntime$b = jsxRuntimeExports; +var _jsxRuntime$b = requireJsxRuntime(); var _default$b = default_1$b = LastPage.default = (0, _createSvgIcon$b.default)(/* @__PURE__ */ (0, _jsxRuntime$b.jsx)("path", { d: "M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z" }), "LastPage"); @@ -25608,7 +25614,7 @@ Object.defineProperty(MoreHoriz, "__esModule", { }); var default_1$a = MoreHoriz.default = void 0; var _createSvgIcon$a = _interopRequireDefault$a(requireCreateSvgIcon()); -var _jsxRuntime$a = jsxRuntimeExports; +var _jsxRuntime$a = requireJsxRuntime(); var _default$a = default_1$a = MoreHoriz.default = (0, _createSvgIcon$a.default)(/* @__PURE__ */ (0, _jsxRuntime$a.jsx)("path", { d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "MoreHoriz"); @@ -25621,7 +25627,7 @@ Object.defineProperty(MoreVert, "__esModule", { }); var default_1$9 = MoreVert.default = void 0; var _createSvgIcon$9 = _interopRequireDefault$9(requireCreateSvgIcon()); -var _jsxRuntime$9 = jsxRuntimeExports; +var _jsxRuntime$9 = requireJsxRuntime(); var _default$9 = default_1$9 = MoreVert.default = (0, _createSvgIcon$9.default)(/* @__PURE__ */ (0, _jsxRuntime$9.jsx)("path", { d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "MoreVert"); @@ -25634,7 +25640,7 @@ Object.defineProperty(PushPin, "__esModule", { }); var default_1$8 = PushPin.default = void 0; var _createSvgIcon$8 = _interopRequireDefault$8(requireCreateSvgIcon()); -var _jsxRuntime$8 = jsxRuntimeExports; +var _jsxRuntime$8 = requireJsxRuntime(); var _default$8 = default_1$8 = PushPin.default = (0, _createSvgIcon$8.default)(/* @__PURE__ */ (0, _jsxRuntime$8.jsx)("path", { fillRule: "evenodd", d: "M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3" @@ -25648,7 +25654,7 @@ Object.defineProperty(RestartAlt, "__esModule", { }); var default_1$7 = RestartAlt.default = void 0; var _createSvgIcon$7 = _interopRequireDefault$7(requireCreateSvgIcon()); -var _jsxRuntime$7 = jsxRuntimeExports; +var _jsxRuntime$7 = requireJsxRuntime(); var _default$7 = default_1$7 = RestartAlt.default = (0, _createSvgIcon$7.default)(/* @__PURE__ */ (0, _jsxRuntime$7.jsx)("path", { d: "M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91" }), "RestartAlt"); @@ -25661,7 +25667,7 @@ Object.defineProperty(Save, "__esModule", { }); var default_1$6 = Save.default = void 0; var _createSvgIcon$6 = _interopRequireDefault$6(requireCreateSvgIcon()); -var _jsxRuntime$6 = jsxRuntimeExports; +var _jsxRuntime$6 = requireJsxRuntime(); var _default$6 = default_1$6 = Save.default = (0, _createSvgIcon$6.default)(/* @__PURE__ */ (0, _jsxRuntime$6.jsx)("path", { d: "M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z" }), "Save"); @@ -25674,7 +25680,7 @@ Object.defineProperty(Search, "__esModule", { }); var default_1$5 = Search.default = void 0; var _createSvgIcon$5 = _interopRequireDefault$5(requireCreateSvgIcon()); -var _jsxRuntime$5 = jsxRuntimeExports; +var _jsxRuntime$5 = requireJsxRuntime(); var _default$5 = default_1$5 = Search.default = (0, _createSvgIcon$5.default)(/* @__PURE__ */ (0, _jsxRuntime$5.jsx)("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14" }), "Search"); @@ -25687,7 +25693,7 @@ Object.defineProperty(SearchOff, "__esModule", { }); var default_1$4 = SearchOff.default = void 0; var _createSvgIcon$4 = _interopRequireDefault$4(requireCreateSvgIcon()); -var _jsxRuntime$4 = jsxRuntimeExports; +var _jsxRuntime$4 = requireJsxRuntime(); var _default$4 = default_1$4 = SearchOff.default = (0, _createSvgIcon$4.default)([/* @__PURE__ */ (0, _jsxRuntime$4.jsx)("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3 6.08 3 3.28 5.64 3.03 9h2.02C5.3 6.75 7.18 5 9.5 5 11.99 5 14 7.01 14 9.5S11.99 14 9.5 14c-.17 0-.33-.03-.5-.05v2.02c.17.02.33.03.5.03 1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19z" }, "0"), /* @__PURE__ */ (0, _jsxRuntime$4.jsx)("path", { @@ -25702,7 +25708,7 @@ Object.defineProperty(Sort, "__esModule", { }); var default_1$3 = Sort.default = void 0; var _createSvgIcon$3 = _interopRequireDefault$3(requireCreateSvgIcon()); -var _jsxRuntime$3 = jsxRuntimeExports; +var _jsxRuntime$3 = requireJsxRuntime(); var _default$3 = default_1$3 = Sort.default = (0, _createSvgIcon$3.default)(/* @__PURE__ */ (0, _jsxRuntime$3.jsx)("path", { d: "M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z" }), "Sort"); @@ -25715,7 +25721,7 @@ Object.defineProperty(SyncAlt, "__esModule", { }); var default_1$2 = SyncAlt.default = void 0; var _createSvgIcon$2 = _interopRequireDefault$2(requireCreateSvgIcon()); -var _jsxRuntime$2 = jsxRuntimeExports; +var _jsxRuntime$2 = requireJsxRuntime(); var _default$2 = default_1$2 = SyncAlt.default = (0, _createSvgIcon$2.default)(/* @__PURE__ */ (0, _jsxRuntime$2.jsx)("path", { d: "m18 12 4-4-4-4v3H3v2h15zM6 12l-4 4 4 4v-3h15v-2H6z" }), "SyncAlt"); @@ -25728,7 +25734,7 @@ Object.defineProperty(ViewColumn, "__esModule", { }); var default_1$1 = ViewColumn.default = void 0; var _createSvgIcon$1 = _interopRequireDefault$1(requireCreateSvgIcon()); -var _jsxRuntime$1 = jsxRuntimeExports; +var _jsxRuntime$1 = requireJsxRuntime(); var _default$1 = default_1$1 = ViewColumn.default = (0, _createSvgIcon$1.default)(/* @__PURE__ */ (0, _jsxRuntime$1.jsx)("path", { d: "M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z" }), "ViewColumn"); @@ -25741,7 +25747,7 @@ Object.defineProperty(VisibilityOff, "__esModule", { }); var default_1 = VisibilityOff.default = void 0; var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon()); -var _jsxRuntime = jsxRuntimeExports; +var _jsxRuntime = requireJsxRuntime(); var _default = default_1 = VisibilityOff.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", { d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z" }), "VisibilityOff"); @@ -64675,9 +64681,10 @@ const BasicEntityAutocompleteFieldSpecShape = gubu_minExports.Gubu(Open$7({ kind: String, label: gubu_minExports.Default(""), options: Open$7({ - default: Open$7({}), label: { field: gubu_minExports.Default("label") }, + value: { field: gubu_minExports.Default("value") }, multiple: gubu_minExports.Default(false), + default: Open$7({}), ents: Open$7({}) }), ux: Open$7({ @@ -64706,7 +64713,7 @@ function BasicEntityAutocompleteField(props) { options: resolvedOptions, isOptionEqualToValue: (opt, val) => opt === val || (opt == null ? void 0 : opt.id) != null && (val == null ? void 0 : val.id) != null && opt.id === val.id || (opt == null ? void 0 : opt.value) != null && (val == null ? void 0 : val.value) != null && opt.value === val.value, getOptionLabel: (option) => option[field.options.label.field], - value, + value: resolveValue(field.options, value), onChange: (_2, newVal) => onChange(newVal), renderInput: (params) => /* @__PURE__ */ jsxRuntimeExports.jsx(TextField$1, __spreadProps(__spreadValues({}, params), { label: field.label })) } @@ -64716,19 +64723,53 @@ function BasicEntityAutocompleteField(props) { ); } function resolveOptions(options) { - const resolvedOptions = Object.keys(options.ents).map((key) => ({ - label: options.ents[key].label, - value: key - })); - const resolvedDefault = options.multiple === false ? Object.keys(options.default).length > 0 ? { value: Object.keys(options.default)[0], label: options.default[Object.keys(options.default)[0]].label } : null : Object.keys(options.default).map((key) => ({ - label: options.default[key].label, - value: key - })); + const { multiple, ents, label, value, default: defaultValues } = options; + const labelField = label == null ? void 0 : label.field; + const valueField = value == null ? void 0 : value.field; + const resolvedOptions = Object.keys(ents).map((key) => { + var _a; + return { + [labelField]: (_a = ents == null ? void 0 : ents[key]) == null ? void 0 : _a[labelField], + [valueField]: key + }; + }); + let resolvedDefault; + if (multiple === false) { + if (Object.keys(defaultValues).length > 0) { + const firstKey = Object.keys(defaultValues)[0]; + resolvedDefault = { value: firstKey, label: defaultValues[firstKey][labelField] }; + } else { + resolvedDefault = null; + } + } else { + resolvedDefault = Object.keys(defaultValues).map((key) => ({ + label: defaultValues[key].label, + value: key + })); + } return { resolvedOptions, resolvedDefault }; } +function resolveValue(options, val) { + const { multiple, ents, label, value } = options; + const labelField = label == null ? void 0 : label.field; + const valueField = value == null ? void 0 : value.field; + const getValue2 = (val2) => { + var _a; + return ((_a = ents == null ? void 0 : ents[val2]) == null ? void 0 : _a[labelField]) ? { [valueField]: val2, [labelField]: ents[val2][labelField] || val2 } : void 0; + }; + if (!multiple) { + return typeof val === "string" ? getValue2(val) : val || void 0; + } else { + if (typeof val === "string") { + const resolvedValue = getValue2(val); + return resolvedValue ? [resolvedValue] : []; + } + return val || []; + } +} const CMPNAME$8 = "BasicEntityField"; const { Open: Open$6 } = gubu_minExports.Gubu; const BasicEntityFieldSpecShape = gubu_minExports.Gubu(Open$6({}), { name: CMPNAME$8 }); diff --git a/dist/voxgig-model-react.umd.js b/dist/voxgig-model-react.umd.js index ffb79bd..482b77d 100644 --- a/dist/voxgig-model-react.umd.js +++ b/dist/voxgig-model-react.umd.js @@ -1042,15 +1042,21 @@ var __async = (__this, __arguments, generator) => { } return reactJsxRuntime_development; } - var jsxRuntime = jsxRuntime$2.exports; - "use strict"; - if (process.env.NODE_ENV === "production") { - jsxRuntime$2.exports = requireReactJsxRuntime_production_min(); - } else { - jsxRuntime$2.exports = requireReactJsxRuntime_development(); + var jsxRuntime$1 = jsxRuntime$2.exports; + var hasRequiredJsxRuntime; + function requireJsxRuntime() { + if (hasRequiredJsxRuntime) return jsxRuntime$2.exports; + hasRequiredJsxRuntime = 1; + "use strict"; + if (process.env.NODE_ENV === "production") { + jsxRuntime$2.exports = requireReactJsxRuntime_production_min(); + } else { + jsxRuntime$2.exports = requireReactJsxRuntime_development(); + } + return jsxRuntime$2.exports; } - var jsxRuntimeExports = jsxRuntime$2.exports; - const jsxRuntime$1 = /* @__PURE__ */ getDefaultExportFromCjs(jsxRuntimeExports); + var jsxRuntimeExports = requireJsxRuntime(); + const jsxRuntime = /* @__PURE__ */ getDefaultExportFromCjs(jsxRuntimeExports); var gubu_min$2 = { exports: {} }; var gubu_min = gubu_min$2.exports; (function(module2, exports3) { @@ -25317,7 +25323,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$x = ArrowDownward.default = void 0; var _createSvgIcon$x = _interopRequireDefault$x(requireCreateSvgIcon()); - var _jsxRuntime$x = jsxRuntimeExports; + var _jsxRuntime$x = requireJsxRuntime(); var _default$x = default_1$x = ArrowDownward.default = (0, _createSvgIcon$x.default)(/* @__PURE__ */ (0, _jsxRuntime$x.jsx)("path", { d: "m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z" }), "ArrowDownward"); @@ -25330,7 +25336,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$w = ArrowRight.default = void 0; var _createSvgIcon$w = _interopRequireDefault$w(requireCreateSvgIcon()); - var _jsxRuntime$w = jsxRuntimeExports; + var _jsxRuntime$w = requireJsxRuntime(); var _default$w = default_1$w = ArrowRight.default = (0, _createSvgIcon$w.default)(/* @__PURE__ */ (0, _jsxRuntime$w.jsx)("path", { d: "m10 17 5-5-5-5z" }), "ArrowRight"); @@ -25343,7 +25349,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$v = Cancel.default = void 0; var _createSvgIcon$v = _interopRequireDefault$v(requireCreateSvgIcon()); - var _jsxRuntime$v = jsxRuntimeExports; + var _jsxRuntime$v = requireJsxRuntime(); var _default$v = default_1$v = Cancel.default = (0, _createSvgIcon$v.default)(/* @__PURE__ */ (0, _jsxRuntime$v.jsx)("path", { d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z" }), "Cancel"); @@ -25356,7 +25362,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$u = ChevronLeft.default = void 0; var _createSvgIcon$u = _interopRequireDefault$u(requireCreateSvgIcon()); - var _jsxRuntime$u = jsxRuntimeExports; + var _jsxRuntime$u = requireJsxRuntime(); var _default$u = default_1$u = ChevronLeft.default = (0, _createSvgIcon$u.default)(/* @__PURE__ */ (0, _jsxRuntime$u.jsx)("path", { d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z" }), "ChevronLeft"); @@ -25369,7 +25375,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$t = ChevronRight.default = void 0; var _createSvgIcon$t = _interopRequireDefault$t(requireCreateSvgIcon()); - var _jsxRuntime$t = jsxRuntimeExports; + var _jsxRuntime$t = requireJsxRuntime(); var _default$t = default_1$t = ChevronRight.default = (0, _createSvgIcon$t.default)(/* @__PURE__ */ (0, _jsxRuntime$t.jsx)("path", { d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }), "ChevronRight"); @@ -25382,7 +25388,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$s = ClearAll.default = void 0; var _createSvgIcon$s = _interopRequireDefault$s(requireCreateSvgIcon()); - var _jsxRuntime$s = jsxRuntimeExports; + var _jsxRuntime$s = requireJsxRuntime(); var _default$s = default_1$s = ClearAll.default = (0, _createSvgIcon$s.default)(/* @__PURE__ */ (0, _jsxRuntime$s.jsx)("path", { d: "M5 13h14v-2H5zm-2 4h14v-2H3zM7 7v2h14V7z" }), "ClearAll"); @@ -25395,7 +25401,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$r = Close.default = void 0; var _createSvgIcon$r = _interopRequireDefault$r(requireCreateSvgIcon()); - var _jsxRuntime$r = jsxRuntimeExports; + var _jsxRuntime$r = requireJsxRuntime(); var _default$r = default_1$r = Close.default = (0, _createSvgIcon$r.default)(/* @__PURE__ */ (0, _jsxRuntime$r.jsx)("path", { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }), "Close"); @@ -25408,7 +25414,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$q = ContentCopy.default = void 0; var _createSvgIcon$q = _interopRequireDefault$q(requireCreateSvgIcon()); - var _jsxRuntime$q = jsxRuntimeExports; + var _jsxRuntime$q = requireJsxRuntime(); var _default$q = default_1$q = ContentCopy.default = (0, _createSvgIcon$q.default)(/* @__PURE__ */ (0, _jsxRuntime$q.jsx)("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z" }), "ContentCopy"); @@ -25421,7 +25427,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$p = DensityLarge.default = void 0; var _createSvgIcon$p = _interopRequireDefault$p(requireCreateSvgIcon()); - var _jsxRuntime$p = jsxRuntimeExports; + var _jsxRuntime$p = requireJsxRuntime(); var _default$p = default_1$p = DensityLarge.default = (0, _createSvgIcon$p.default)(/* @__PURE__ */ (0, _jsxRuntime$p.jsx)("path", { d: "M3 3h18v2H3zm0 16h18v2H3z" }), "DensityLarge"); @@ -25434,7 +25440,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$o = DensityMedium.default = void 0; var _createSvgIcon$o = _interopRequireDefault$o(requireCreateSvgIcon()); - var _jsxRuntime$o = jsxRuntimeExports; + var _jsxRuntime$o = requireJsxRuntime(); var _default$o = default_1$o = DensityMedium.default = (0, _createSvgIcon$o.default)(/* @__PURE__ */ (0, _jsxRuntime$o.jsx)("path", { d: "M3 3h18v2H3zm0 16h18v2H3zm0-8h18v2H3z" }), "DensityMedium"); @@ -25447,7 +25453,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$n = DensitySmall.default = void 0; var _createSvgIcon$n = _interopRequireDefault$n(requireCreateSvgIcon()); - var _jsxRuntime$n = jsxRuntimeExports; + var _jsxRuntime$n = requireJsxRuntime(); var _default$n = default_1$n = DensitySmall.default = (0, _createSvgIcon$n.default)(/* @__PURE__ */ (0, _jsxRuntime$n.jsx)("path", { d: "M3 2h18v2H3zm0 18h18v2H3zm0-6h18v2H3zm0-6h18v2H3z" }), "DensitySmall"); @@ -25460,7 +25466,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$m = DragHandle.default = void 0; var _createSvgIcon$m = _interopRequireDefault$m(requireCreateSvgIcon()); - var _jsxRuntime$m = jsxRuntimeExports; + var _jsxRuntime$m = requireJsxRuntime(); var _default$m = default_1$m = DragHandle.default = (0, _createSvgIcon$m.default)(/* @__PURE__ */ (0, _jsxRuntime$m.jsx)("path", { d: "M20 9H4v2h16zM4 15h16v-2H4z" }), "DragHandle"); @@ -25473,7 +25479,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$l = DynamicFeed.default = void 0; var _createSvgIcon$l = _interopRequireDefault$l(requireCreateSvgIcon()); - var _jsxRuntime$l = jsxRuntimeExports; + var _jsxRuntime$l = requireJsxRuntime(); var _default$l = default_1$l = DynamicFeed.default = (0, _createSvgIcon$l.default)([/* @__PURE__ */ (0, _jsxRuntime$l.jsx)("path", { d: "M8 8H6v7c0 1.1.9 2 2 2h9v-2H8z" }, "0"), /* @__PURE__ */ (0, _jsxRuntime$l.jsx)("path", { @@ -25488,7 +25494,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$k = Edit.default = void 0; var _createSvgIcon$k = _interopRequireDefault$k(requireCreateSvgIcon()); - var _jsxRuntime$k = jsxRuntimeExports; + var _jsxRuntime$k = requireJsxRuntime(); var _default$k = default_1$k = Edit.default = (0, _createSvgIcon$k.default)(/* @__PURE__ */ (0, _jsxRuntime$k.jsx)("path", { d: "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z" }), "Edit"); @@ -25501,7 +25507,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$j = ExpandMore.default = void 0; var _createSvgIcon$j = _interopRequireDefault$j(requireCreateSvgIcon()); - var _jsxRuntime$j = jsxRuntimeExports; + var _jsxRuntime$j = requireJsxRuntime(); var _default$j = default_1$j = ExpandMore.default = (0, _createSvgIcon$j.default)(/* @__PURE__ */ (0, _jsxRuntime$j.jsx)("path", { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }), "ExpandMore"); @@ -25514,7 +25520,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$i = FilterAlt.default = void 0; var _createSvgIcon$i = _interopRequireDefault$i(requireCreateSvgIcon()); - var _jsxRuntime$i = jsxRuntimeExports; + var _jsxRuntime$i = requireJsxRuntime(); var _default$i = default_1$i = FilterAlt.default = (0, _createSvgIcon$i.default)(/* @__PURE__ */ (0, _jsxRuntime$i.jsx)("path", { d: "M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61" }), "FilterAlt"); @@ -25527,7 +25533,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$h = FilterList.default = void 0; var _createSvgIcon$h = _interopRequireDefault$h(requireCreateSvgIcon()); - var _jsxRuntime$h = jsxRuntimeExports; + var _jsxRuntime$h = requireJsxRuntime(); var _default$h = default_1$h = FilterList.default = (0, _createSvgIcon$h.default)(/* @__PURE__ */ (0, _jsxRuntime$h.jsx)("path", { d: "M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z" }), "FilterList"); @@ -25540,7 +25546,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$g = FilterListOff.default = void 0; var _createSvgIcon$g = _interopRequireDefault$g(requireCreateSvgIcon()); - var _jsxRuntime$g = jsxRuntimeExports; + var _jsxRuntime$g = requireJsxRuntime(); var _default$g = default_1$g = FilterListOff.default = (0, _createSvgIcon$g.default)(/* @__PURE__ */ (0, _jsxRuntime$g.jsx)("path", { d: "M10.83 8H21V6H8.83zm5 5H18v-2h-4.17zM14 16.83V18h-4v-2h3.17l-3-3H6v-2h2.17l-3-3H3V6h.17L1.39 4.22 2.8 2.81l18.38 18.38-1.41 1.41z" }), "FilterListOff"); @@ -25553,7 +25559,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$f = FirstPage.default = void 0; var _createSvgIcon$f = _interopRequireDefault$f(requireCreateSvgIcon()); - var _jsxRuntime$f = jsxRuntimeExports; + var _jsxRuntime$f = requireJsxRuntime(); var _default$f = default_1$f = FirstPage.default = (0, _createSvgIcon$f.default)(/* @__PURE__ */ (0, _jsxRuntime$f.jsx)("path", { d: "M18.41 16.59 13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z" }), "FirstPage"); @@ -25566,7 +25572,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$e = Fullscreen.default = void 0; var _createSvgIcon$e = _interopRequireDefault$e(requireCreateSvgIcon()); - var _jsxRuntime$e = jsxRuntimeExports; + var _jsxRuntime$e = requireJsxRuntime(); var _default$e = default_1$e = Fullscreen.default = (0, _createSvgIcon$e.default)(/* @__PURE__ */ (0, _jsxRuntime$e.jsx)("path", { d: "M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z" }), "Fullscreen"); @@ -25579,7 +25585,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$d = FullscreenExit.default = void 0; var _createSvgIcon$d = _interopRequireDefault$d(requireCreateSvgIcon()); - var _jsxRuntime$d = jsxRuntimeExports; + var _jsxRuntime$d = requireJsxRuntime(); var _default$d = default_1$d = FullscreenExit.default = (0, _createSvgIcon$d.default)(/* @__PURE__ */ (0, _jsxRuntime$d.jsx)("path", { d: "M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z" }), "FullscreenExit"); @@ -25592,7 +25598,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$c = KeyboardDoubleArrowDown.default = void 0; var _createSvgIcon$c = _interopRequireDefault$c(requireCreateSvgIcon()); - var _jsxRuntime$c = jsxRuntimeExports; + var _jsxRuntime$c = requireJsxRuntime(); var _default$c = default_1$c = KeyboardDoubleArrowDown.default = (0, _createSvgIcon$c.default)([/* @__PURE__ */ (0, _jsxRuntime$c.jsx)("path", { d: "M18 6.41 16.59 5 12 9.58 7.41 5 6 6.41l6 6z" }, "0"), /* @__PURE__ */ (0, _jsxRuntime$c.jsx)("path", { @@ -25607,7 +25613,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$b = LastPage.default = void 0; var _createSvgIcon$b = _interopRequireDefault$b(requireCreateSvgIcon()); - var _jsxRuntime$b = jsxRuntimeExports; + var _jsxRuntime$b = requireJsxRuntime(); var _default$b = default_1$b = LastPage.default = (0, _createSvgIcon$b.default)(/* @__PURE__ */ (0, _jsxRuntime$b.jsx)("path", { d: "M5.59 7.41 10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z" }), "LastPage"); @@ -25620,7 +25626,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$a = MoreHoriz.default = void 0; var _createSvgIcon$a = _interopRequireDefault$a(requireCreateSvgIcon()); - var _jsxRuntime$a = jsxRuntimeExports; + var _jsxRuntime$a = requireJsxRuntime(); var _default$a = default_1$a = MoreHoriz.default = (0, _createSvgIcon$a.default)(/* @__PURE__ */ (0, _jsxRuntime$a.jsx)("path", { d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "MoreHoriz"); @@ -25633,7 +25639,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$9 = MoreVert.default = void 0; var _createSvgIcon$9 = _interopRequireDefault$9(requireCreateSvgIcon()); - var _jsxRuntime$9 = jsxRuntimeExports; + var _jsxRuntime$9 = requireJsxRuntime(); var _default$9 = default_1$9 = MoreVert.default = (0, _createSvgIcon$9.default)(/* @__PURE__ */ (0, _jsxRuntime$9.jsx)("path", { d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "MoreVert"); @@ -25646,7 +25652,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$8 = PushPin.default = void 0; var _createSvgIcon$8 = _interopRequireDefault$8(requireCreateSvgIcon()); - var _jsxRuntime$8 = jsxRuntimeExports; + var _jsxRuntime$8 = requireJsxRuntime(); var _default$8 = default_1$8 = PushPin.default = (0, _createSvgIcon$8.default)(/* @__PURE__ */ (0, _jsxRuntime$8.jsx)("path", { fillRule: "evenodd", d: "M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3" @@ -25660,7 +25666,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$7 = RestartAlt.default = void 0; var _createSvgIcon$7 = _interopRequireDefault$7(requireCreateSvgIcon()); - var _jsxRuntime$7 = jsxRuntimeExports; + var _jsxRuntime$7 = requireJsxRuntime(); var _default$7 = default_1$7 = RestartAlt.default = (0, _createSvgIcon$7.default)(/* @__PURE__ */ (0, _jsxRuntime$7.jsx)("path", { d: "M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91" }), "RestartAlt"); @@ -25673,7 +25679,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$6 = Save.default = void 0; var _createSvgIcon$6 = _interopRequireDefault$6(requireCreateSvgIcon()); - var _jsxRuntime$6 = jsxRuntimeExports; + var _jsxRuntime$6 = requireJsxRuntime(); var _default$6 = default_1$6 = Save.default = (0, _createSvgIcon$6.default)(/* @__PURE__ */ (0, _jsxRuntime$6.jsx)("path", { d: "M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z" }), "Save"); @@ -25686,7 +25692,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$5 = Search.default = void 0; var _createSvgIcon$5 = _interopRequireDefault$5(requireCreateSvgIcon()); - var _jsxRuntime$5 = jsxRuntimeExports; + var _jsxRuntime$5 = requireJsxRuntime(); var _default$5 = default_1$5 = Search.default = (0, _createSvgIcon$5.default)(/* @__PURE__ */ (0, _jsxRuntime$5.jsx)("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14" }), "Search"); @@ -25699,7 +25705,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$4 = SearchOff.default = void 0; var _createSvgIcon$4 = _interopRequireDefault$4(requireCreateSvgIcon()); - var _jsxRuntime$4 = jsxRuntimeExports; + var _jsxRuntime$4 = requireJsxRuntime(); var _default$4 = default_1$4 = SearchOff.default = (0, _createSvgIcon$4.default)([/* @__PURE__ */ (0, _jsxRuntime$4.jsx)("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3 6.08 3 3.28 5.64 3.03 9h2.02C5.3 6.75 7.18 5 9.5 5 11.99 5 14 7.01 14 9.5S11.99 14 9.5 14c-.17 0-.33-.03-.5-.05v2.02c.17.02.33.03.5.03 1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19z" }, "0"), /* @__PURE__ */ (0, _jsxRuntime$4.jsx)("path", { @@ -25714,7 +25720,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$3 = Sort.default = void 0; var _createSvgIcon$3 = _interopRequireDefault$3(requireCreateSvgIcon()); - var _jsxRuntime$3 = jsxRuntimeExports; + var _jsxRuntime$3 = requireJsxRuntime(); var _default$3 = default_1$3 = Sort.default = (0, _createSvgIcon$3.default)(/* @__PURE__ */ (0, _jsxRuntime$3.jsx)("path", { d: "M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z" }), "Sort"); @@ -25727,7 +25733,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$2 = SyncAlt.default = void 0; var _createSvgIcon$2 = _interopRequireDefault$2(requireCreateSvgIcon()); - var _jsxRuntime$2 = jsxRuntimeExports; + var _jsxRuntime$2 = requireJsxRuntime(); var _default$2 = default_1$2 = SyncAlt.default = (0, _createSvgIcon$2.default)(/* @__PURE__ */ (0, _jsxRuntime$2.jsx)("path", { d: "m18 12 4-4-4-4v3H3v2h15zM6 12l-4 4 4 4v-3h15v-2H6z" }), "SyncAlt"); @@ -25740,7 +25746,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1$1 = ViewColumn.default = void 0; var _createSvgIcon$1 = _interopRequireDefault$1(requireCreateSvgIcon()); - var _jsxRuntime$1 = jsxRuntimeExports; + var _jsxRuntime$1 = requireJsxRuntime(); var _default$1 = default_1$1 = ViewColumn.default = (0, _createSvgIcon$1.default)(/* @__PURE__ */ (0, _jsxRuntime$1.jsx)("path", { d: "M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z" }), "ViewColumn"); @@ -25753,7 +25759,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha }); var default_1 = VisibilityOff.default = void 0; var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon()); - var _jsxRuntime = jsxRuntimeExports; + var _jsxRuntime = requireJsxRuntime(); var _default = default_1 = VisibilityOff.default = (0, _createSvgIcon.default)(/* @__PURE__ */ (0, _jsxRuntime.jsx)("path", { d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z" }), "VisibilityOff"); @@ -64687,9 +64693,10 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha kind: String, label: gubu_minExports.Default(""), options: Open$7({ - default: Open$7({}), label: { field: gubu_minExports.Default("label") }, + value: { field: gubu_minExports.Default("value") }, multiple: gubu_minExports.Default(false), + default: Open$7({}), ents: Open$7({}) }), ux: Open$7({ @@ -64718,7 +64725,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha options: resolvedOptions, isOptionEqualToValue: (opt, val) => opt === val || (opt == null ? void 0 : opt.id) != null && (val == null ? void 0 : val.id) != null && opt.id === val.id || (opt == null ? void 0 : opt.value) != null && (val == null ? void 0 : val.value) != null && opt.value === val.value, getOptionLabel: (option) => option[field.options.label.field], - value, + value: resolveValue(field.options, value), onChange: (_2, newVal) => onChange(newVal), renderInput: (params) => /* @__PURE__ */ jsxRuntimeExports.jsx(material.TextField, __spreadProps(__spreadValues({}, params), { label: field.label })) } @@ -64728,19 +64735,53 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha ); } function resolveOptions(options) { - const resolvedOptions = Object.keys(options.ents).map((key) => ({ - label: options.ents[key].label, - value: key - })); - const resolvedDefault = options.multiple === false ? Object.keys(options.default).length > 0 ? { value: Object.keys(options.default)[0], label: options.default[Object.keys(options.default)[0]].label } : null : Object.keys(options.default).map((key) => ({ - label: options.default[key].label, - value: key - })); + const { multiple, ents, label, value, default: defaultValues } = options; + const labelField = label == null ? void 0 : label.field; + const valueField = value == null ? void 0 : value.field; + const resolvedOptions = Object.keys(ents).map((key) => { + var _a; + return { + [labelField]: (_a = ents == null ? void 0 : ents[key]) == null ? void 0 : _a[labelField], + [valueField]: key + }; + }); + let resolvedDefault; + if (multiple === false) { + if (Object.keys(defaultValues).length > 0) { + const firstKey = Object.keys(defaultValues)[0]; + resolvedDefault = { value: firstKey, label: defaultValues[firstKey][labelField] }; + } else { + resolvedDefault = null; + } + } else { + resolvedDefault = Object.keys(defaultValues).map((key) => ({ + label: defaultValues[key].label, + value: key + })); + } return { resolvedOptions, resolvedDefault }; } + function resolveValue(options, val) { + const { multiple, ents, label, value } = options; + const labelField = label == null ? void 0 : label.field; + const valueField = value == null ? void 0 : value.field; + const getValue2 = (val2) => { + var _a; + return ((_a = ents == null ? void 0 : ents[val2]) == null ? void 0 : _a[labelField]) ? { [valueField]: val2, [labelField]: ents[val2][labelField] || val2 } : void 0; + }; + if (!multiple) { + return typeof val === "string" ? getValue2(val) : val || void 0; + } else { + if (typeof val === "string") { + const resolvedValue = getValue2(val); + return resolvedValue ? [resolvedValue] : []; + } + return val || []; + } + } const CMPNAME$8 = "BasicEntityField"; const { Open: Open$6 } = gubu_minExports.Gubu; const BasicEntityFieldSpecShape = gubu_minExports.Gubu(Open$6({}), { name: CMPNAME$8 }); diff --git a/src/lib/BasicEntityAutocompleteField.tsx b/src/lib/BasicEntityAutocompleteField.tsx index bd42836..bd8e816 100644 --- a/src/lib/BasicEntityAutocompleteField.tsx +++ b/src/lib/BasicEntityAutocompleteField.tsx @@ -16,9 +16,10 @@ const BasicEntityAutocompleteFieldSpecShape = Gubu(Open({ kind: String, label: Default(''), options: Open({ - default: Open({}), label: { field: Default('label') }, + value: { field: Default('value') }, multiple: Default(false), + default: Open({}), ents: Open({}) }), ux: Open({ @@ -31,8 +32,6 @@ const BasicEntityAutocompleteFieldSpecShape = Gubu(Open({ function BasicEntityAutocompleteField(props: any) { const { spec } = props - // console.log('BasicEntityAutocompleteField', spec) - const basicEntityAutocompleteField: Spec = BasicEntityAutocompleteFieldSpecShape(spec) const { control, field } = basicEntityAutocompleteField const { resolvedOptions, resolvedDefault } = resolveOptions(field.options); @@ -55,7 +54,7 @@ function BasicEntityAutocompleteField(props: any) { (opt?.value != null && val?.value != null && opt.value === val.value) } getOptionLabel={(option: any) => option[field.options.label.field]} - value={value} + value={resolveValue(field.options, value)} onChange={(_, newVal: any) => onChange(newVal)} renderInput={(params: any) => } /> @@ -66,27 +65,52 @@ function BasicEntityAutocompleteField(props: any) { // Returns array of options and default value(s) based on the options object function resolveOptions(options: any) { + const { multiple, ents, label, value, default: defaultValues } = options; + const labelField = label?.field; + const valueField = value?.field; + // Array of options - const resolvedOptions = Object.keys(options.ents).map(key => ({ - label: options.ents[key].label, - value: key - })) + const resolvedOptions = Object.keys(ents).map(key => ({ + [labelField]: ents?.[key]?.[labelField], + [valueField]: key + })); - // Array of default values (or single value if multiple is false) - const resolvedDefault = options.multiple === false ? ( - Object.keys(options.default).length > 0 - ? { value: Object.keys(options.default)[0], label: options.default[Object.keys(options.default)[0]].label } - : null - ) : ( - Object.keys(options.default).map(key => ({ - label: options.default[key].label, + let resolvedDefault; + if (multiple === false) { + if (Object.keys(defaultValues).length > 0) { + const firstKey = Object.keys(defaultValues)[0]; + resolvedDefault = { value: firstKey, label: defaultValues[firstKey][labelField] }; + } else { + resolvedDefault = null; + } + } else { + resolvedDefault = Object.keys(defaultValues).map(key => ({ + label: defaultValues[key].label, value: key - })) - ) + })); + } return { resolvedOptions, resolvedDefault + }; +} + +function resolveValue(options: any, val: any) { + const { multiple, ents, label, value } = options; + const labelField = label?.field; + const valueField = value?.field; + + const getValue = (val: string) => ents?.[val]?.[labelField] ? { [valueField]: val, [labelField]: ents[val][labelField] || val } : undefined; + + if (!multiple) { + return typeof val === 'string' ? getValue(val) : (val || undefined); + } else { + if (typeof val === 'string') { + const resolvedValue = getValue(val); + return resolvedValue ? [resolvedValue] : []; + } + return val || []; } }