@economic/taco 2.28.1 → 2.29.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Icon/components/Phone.d.ts +3 -0
- package/dist/components/Icon/components/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/List/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/components/Navigation2/components/Link.d.ts +1 -1
- package/dist/components/Select2/components/Option.d.ts +2 -2
- package/dist/components/Select2/components/Search.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/esm/index.css +10 -6
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +45 -43
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Phone.js +17 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Phone.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js +2 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js +9 -2
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js +4 -1
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js +3 -7
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js +11 -9
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleColumnFreezing.js +4 -2
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleColumnFreezing.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js +9 -8
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js +7 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +15 -11
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/date.js +3 -3
- package/dist/esm/packages/taco/src/utils/date.js.map +1 -1
- package/dist/index.css +10 -6
- package/dist/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.d.ts +1 -3
- package/dist/primitives/Table/useTableManager/util/columns.d.ts +1 -1
- package/dist/taco.cjs.development.js +128 -91
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/dist/utils/date.d.ts +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCombobox.js","sources":["../../../../../../../src/components/Combobox/useCombobox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { v4 as uuid } from 'uuid';\nimport debounce from 'lodash/debounce';\nimport { ComboboxProps } from './Combobox';\nimport {\n setInputValueByRef,\n getIndexFromValue,\n findByValue,\n useFlattenedData,\n sanitizeItem,\n getOptionParents,\n filterData,\n} from '../Listbox/util';\nimport { createCustomKeyboardEvent } from '../../utils/input';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { getId, ScrollableListItemValue, ScrollableListPropsWithRef } from '../Listbox/ScrollableList';\nimport { InputProps } from '../Input/Input';\n\nconst debouncer = debounce(f => f(), 200);\n\nconst convertToInputValue = (value: ScrollableListItemValue | undefined) => String(value ?? '');\n\ntype useCombobox = React.HTMLAttributes<HTMLDivElement> & {\n combobox: React.HTMLAttributes<HTMLSpanElement>;\n input: Omit<InputProps, 'defaultValue'> & { ref: React.RefObject<HTMLInputElement> };\n list: ScrollableListPropsWithRef;\n button: { ref: any };\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\n};\n\nexport const useCombobox = (\n {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data: unfilteredData = [],\n defaultValue,\n disabled,\n id: nativeId,\n inline,\n loading: __,\n onChange,\n onClick,\n onKeyDown,\n onSearch,\n readOnly,\n value,\n ...props\n }: Omit<ComboboxProps, 'dialog'>,\n ref: React.Ref<HTMLInputElement>\n): useCombobox => {\n const inputRef = useMergedRef<HTMLInputElement>(ref);\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const listRef = React.useRef<HTMLUListElement>(null);\n const [open, setOpen] = React.useState(false);\n const listId = React.useMemo(() => uuid(), []);\n const [inputValue, setInputValue] = React.useState<string>(convertToInputValue(value));\n const shouldFilterData = !onSearch && (!inline || (inline && inputValue !== convertToInputValue(value)));\n const flattenedData = useFlattenedData(unfilteredData);\n const data = React.useMemo(\n () => (shouldFilterData ? filterData(flattenedData, inputValue) : flattenedData),\n [shouldFilterData, inputValue, flattenedData]\n );\n // listbox/select change value _with_ the index, but combobox changes on select of an index (click/enter), so we need state\n const [currentIndex, setCurrentIndex] = React.useState<number | undefined>(\n inputValue !== undefined ? getIndexFromValue(data, inputValue) : undefined\n );\n\n const setInputValueByIndex = (index: number | undefined): void => {\n if (index !== undefined) {\n const option = data[index];\n\n if (option && !option.disabled) {\n setInputValueByRef(inputRef.current, option.value, 'focusout');\n }\n }\n };\n\n const setCurrentValue = (index: number | undefined) => {\n if (index === undefined) {\n return;\n }\n\n const option = data[index];\n\n // if the selected option is not already selected, trigger blur event\n if (option.value !== value) {\n setInputValueByIndex(index);\n } else {\n // if the selected option is already selected, refill input with its value\n setInputValue(convertToInputValue(value));\n }\n };\n\n // ensure the external value is synced with the internal value when mounting, e.g. incase a default value was set\n React.useEffect(() => {\n if (defaultValue && !value) {\n setInputValueByIndex(getIndexFromValue(data, defaultValue));\n }\n }, [data]);\n\n // update input value if it changed 'externally', e.g. clicking/entering an item in the listbox, from a modal etc\n React.useEffect(() => {\n if (value !== undefined && value !== inputValue) {\n setInputValue(convertToInputValue(value));\n }\n }, [value]);\n\n React.useEffect(() => {\n if (onSearch) {\n debouncer(() => {\n onSearch(inputValue);\n });\n }\n }, [inputValue]);\n\n // show listbox based on input value\n React.useEffect(() => {\n // don't show the popover if the internal (input) value already is the current value\n // this prevents the popover showing after selecting a value or pressing escape\n const isCurrentValue = value !== undefined && value !== null && inputValue === String(value);\n\n if (inputValue && data.length && !isCurrentValue) {\n setCurrentIndex(0);\n\n if (!open) {\n setOpen(true);\n }\n } else {\n setOpen(false);\n }\n }, [inputValue, data]);\n\n React.useEffect(() => {\n if (open) {\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\n } else {\n setCurrentIndex(undefined);\n }\n }, [open]);\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n event.persist();\n\n if (listRef.current && event.relatedTarget === listRef.current) {\n event.preventDefault();\n return;\n }\n\n // event.target.value is always a string so it is important to cast value to a string before checking the equality\n if (onChange && event.target.value !== String(value)) {\n const item = findByValue(flattenedData, event.target.value);\n (event as any).detail = sanitizeItem(item);\n\n const parents = getOptionParents(flattenedData, item?.path);\n\n if (parents !== null && parents.length > 0) {\n (event as any).detail.parents = parents;\n }\n\n onChange(event);\n }\n\n if (props.onBlur) {\n props.onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInputValue(event.target.value);\n };\n\n const handleInputClick = (event: React.MouseEvent<HTMLInputElement>): void => {\n if (inline || (!open && inputValue && data.length)) {\n setOpen(true);\n }\n\n if (onClick) {\n event.persist();\n onClick(event);\n }\n };\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n event.persist();\n\n switch (event.key) {\n case 'Backspace': {\n return;\n }\n\n case 'Escape': {\n event.preventDefault();\n setInputValue(convertToInputValue(value));\n setOpen(false);\n return;\n }\n\n case 'Tab':\n case 'Enter': {\n if (event.key !== 'Tab') {\n event.preventDefault();\n }\n\n setCurrentValue(currentIndex);\n setOpen(false);\n return;\n }\n\n case 'ArrowDown':\n if (open) {\n event.preventDefault();\n } else {\n if (!inline && buttonRef.current) {\n buttonRef.current.click();\n }\n }\n break;\n\n case 'ArrowUp':\n case 'Home':\n case 'End': {\n if (open) {\n event.preventDefault();\n }\n break;\n }\n\n default:\n }\n\n // we aren't focused on the list, so manually forward the keydown event to it\n if (listRef.current) {\n listRef.current.dispatchEvent(createCustomKeyboardEvent(event));\n }\n\n if (inline && !open) {\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n const initialIndex = event.key === 'ArrowUp' ? data.length - 1 : 0;\n setCurrentIndex(currentIndex !== undefined ? currentIndex : initialIndex);\n setOpen(true);\n }\n }\n\n if (!event.isDefaultPrevented() && onKeyDown) {\n event.persist();\n onKeyDown(event);\n }\n };\n\n const handleListboxChange = (index: number): void => {\n setCurrentIndex(index);\n };\n\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>, index: number): void => {\n event.preventDefault();\n setCurrentValue(index);\n setOpen(false);\n };\n\n const combobox = {\n 'aria-expanded': open,\n 'aria-owns': listId,\n 'aria-haspopup': 'listbox' as const,\n role: 'combobox',\n };\n\n const input = {\n ...props,\n 'aria-controls': listId,\n // Indicates that the autocomplete behavior of the text input is to suggest a list of possible values in a popup and that the suggestions\n // are related to the string that is present in the textbox\n 'aria-autocomplete': 'list' as const,\n // Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the input element\n 'aria-activedescendant':\n currentIndex !== undefined && data[currentIndex] ? getId(listId, String(data[currentIndex].value)) : undefined,\n 'aria-labelledby': ariaLabelledBy,\n disabled,\n onBlur: !disabled && !readOnly ? handleInputBlur : undefined,\n onChange: !disabled && !readOnly ? handleInputChange : undefined,\n onClick: !disabled && !readOnly ? handleInputClick : undefined,\n onKeyDown: !disabled && !readOnly ? handleInputKeyDown : undefined,\n readOnly,\n ref: inputRef,\n type: 'text',\n value: inputValue ?? '',\n };\n\n const list: ScrollableListPropsWithRef = {\n 'aria-labelledby': ariaLabelledBy,\n data,\n disabled,\n id: listId,\n onChange: handleListboxChange,\n onClick: handleListboxClick,\n ref: listRef,\n scrollOnFocus: false,\n tabIndex: -1,\n value: currentIndex,\n };\n\n const button = {\n ref: buttonRef,\n };\n\n return {\n combobox,\n input,\n list,\n button,\n popover: {\n open,\n onOpenChange: setOpen,\n //visible: !data.length ? false : open,\n },\n };\n};\n"],"names":["debouncer","debounce","f","convertToInputValue","value","String","useCombobox","ariaLabel","ariaLabelledBy","data","unfilteredData","defaultValue","disabled","id","nativeId","inline","loading","__","onChange","onClick","onKeyDown","onSearch","readOnly","props","ref","inputRef","useMergedRef","buttonRef","React","listRef","open","setOpen","listId","uuid","inputValue","setInputValue","shouldFilterData","flattenedData","useFlattenedData","filterData","currentIndex","setCurrentIndex","undefined","getIndexFromValue","setInputValueByIndex","index","option","setInputValueByRef","current","setCurrentValue","isCurrentValue","length","handleInputBlur","event","persist","relatedTarget","preventDefault","target","item","findByValue","detail","sanitizeItem","parents","getOptionParents","path","onBlur","handleInputChange","handleInputClick","handleInputKeyDown","key","click","dispatchEvent","createCustomKeyboardEvent","initialIndex","isDefaultPrevented","handleListboxChange","handleListboxClick","combobox","role","input","getId","type","list","scrollOnFocus","tabIndex","button","popover","onOpenChange"],"mappings":";;;;;;;;AAkBA,MAAMA,SAAS,gBAAGC,QAAQ,CAACC,CAAC,IAAIA,CAAC,EAAE,EAAE,GAAG,CAAC;AAEzC,MAAMC,mBAAmB,GAAIC,KAA0C,IAAKC,MAAM,CAACD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,CAAC;MAUlFE,WAAW,GAAGA,CACvB;EACI,YAAY,EAAEC,SAAS;EACvB,iBAAiB,EAAEC,cAAc;EACjCC,IAAI,EAAEC,cAAc,GAAG,EAAE;EACzBC,YAAY;EACZC,QAAQ;EACRC,EAAE,EAAEC,QAAQ;EACZC,MAAM;EACNC,OAAO,EAAEC,EAAE;EACXC,QAAQ;EACRC,OAAO;EACPC,SAAS;EACTC,QAAQ;EACRC,QAAQ;EACRlB,KAAK;EACL,GAAGmB;CACyB,EAChCC,GAAgC;EAEhC,MAAMC,QAAQ,GAAGC,YAAY,CAAmBF,GAAG,CAAC;EACpD,MAAMG,SAAS,GAAGC,MAAY,CAAoB,IAAI,CAAC;EACvD,MAAMC,OAAO,GAAGD,MAAY,CAAmB,IAAI,CAAC;EACpD,MAAM,CAACE,IAAI,EAAEC,OAAO,CAAC,GAAGH,QAAc,CAAC,KAAK,CAAC;EAC7C,MAAMI,MAAM,GAAGJ,OAAa,CAAC,MAAMK,EAAI,EAAE,EAAE,EAAE,CAAC;EAC9C,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGP,QAAc,CAASzB,mBAAmB,CAACC,KAAK,CAAC,CAAC;EACtF,MAAMgC,gBAAgB,GAAG,CAACf,QAAQ,KAAK,CAACN,MAAM,IAAKA,MAAM,IAAImB,UAAU,KAAK/B,mBAAmB,CAACC,KAAK,CAAE,CAAC;EACxG,MAAMiC,aAAa,G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M6C,MAAM,GAAG;IACX7D,GAAG,EAAEG;GACR;EAED,OAAO;IACHkD,QAAQ;IACRE,KAAK;IACLG,IAAI;IACJG,MAAM;IACNC,OAAO,EAAE;MACLxD,IAAI;MACJyD,YAAY,EAAExD;;GAGrB;AACL;;;;"}
|
1
|
+
{"version":3,"file":"useCombobox.js","sources":["../../../../../../../src/components/Combobox/useCombobox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { v4 as uuid } from 'uuid';\nimport debounce from 'lodash/debounce';\nimport { ComboboxProps } from './Combobox';\nimport {\n setInputValueByRef,\n getIndexFromValue,\n findByValue,\n useFlattenedData,\n sanitizeItem,\n getOptionParents,\n filterData,\n} from '../Listbox/util';\nimport { createCustomKeyboardEvent } from '../../utils/input';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { getId, ScrollableListItemValue, ScrollableListPropsWithRef } from '../Listbox/ScrollableList';\nimport { InputProps } from '../Input/Input';\n\nconst debouncer = debounce(f => f(), 200);\n\nconst convertToInputValue = (value: ScrollableListItemValue | undefined) => String(value ?? '');\n\ntype useCombobox = React.HTMLAttributes<HTMLDivElement> & {\n combobox: React.HTMLAttributes<HTMLSpanElement>;\n input: Omit<InputProps, 'defaultValue'> & { ref: React.RefObject<HTMLInputElement> };\n list: ScrollableListPropsWithRef;\n button: { ref: any };\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\n};\n\nexport const useCombobox = (\n {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data: unfilteredData = [],\n defaultValue,\n disabled,\n id: nativeId,\n inline,\n loading: __,\n onChange,\n onClick,\n onKeyDown,\n onSearch,\n readOnly,\n value,\n ...props\n }: Omit<ComboboxProps, 'dialog'>,\n ref: React.Ref<HTMLInputElement>\n): useCombobox => {\n const inputRef = useMergedRef<HTMLInputElement>(ref);\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const listRef = React.useRef<HTMLUListElement>(null);\n const [open, setOpen] = React.useState(false);\n const listId = React.useMemo(() => uuid(), []);\n const [inputValue, setInputValue] = React.useState<string>(convertToInputValue(value));\n const shouldFilterData = !onSearch && (!inline || (inline && inputValue !== convertToInputValue(value)));\n const flattenedData = useFlattenedData(unfilteredData);\n const data = React.useMemo(\n () => (shouldFilterData ? filterData(flattenedData, inputValue) : flattenedData),\n [shouldFilterData, inputValue, flattenedData]\n );\n // listbox/select change value _with_ the index, but combobox changes on select of an index (click/enter), so we need state\n const [currentIndex, setCurrentIndex] = React.useState<number | undefined>(\n inputValue !== undefined ? getIndexFromValue(data, inputValue) : undefined\n );\n\n const setInputValueByIndex = (index: number | undefined): void => {\n if (index !== undefined) {\n const option = data[index];\n\n if (option && !option.disabled) {\n setInputValueByRef(inputRef.current, option.value, 'focusout');\n }\n }\n };\n\n const setCurrentValue = (index: number | undefined) => {\n if (index === undefined) {\n return;\n }\n\n const option = data[index];\n\n // if the selected option is not already selected, trigger blur event\n if (option.value !== value) {\n setInputValueByIndex(index);\n } else {\n // if the selected option is already selected, refill input with its value\n setInputValue(convertToInputValue(value));\n }\n };\n\n // ensure the external value is synced with the internal value when mounting, e.g. incase a default value was set\n React.useEffect(() => {\n if (defaultValue && !value) {\n setInputValueByIndex(getIndexFromValue(data, defaultValue));\n }\n }, [data]);\n\n // update input value if it changed 'externally', e.g. clicking/entering an item in the listbox, from a modal etc\n React.useEffect(() => {\n if (value !== undefined && value !== inputValue) {\n setInputValue(convertToInputValue(value));\n }\n }, [value]);\n\n React.useEffect(() => {\n if (onSearch) {\n debouncer(() => {\n onSearch(inputValue);\n });\n }\n }, [inputValue]);\n\n // show listbox based on input value\n React.useEffect(() => {\n // don't show the popover if the internal (input) value already is the current value\n // this prevents the popover showing after selecting a value or pressing escape\n const isCurrentValue = value !== undefined && value !== null && inputValue === String(value);\n\n if (inputValue && data.length && !isCurrentValue) {\n setCurrentIndex(0);\n\n if (!open) {\n setOpen(true);\n }\n } else {\n setOpen(false);\n }\n }, [inputValue, data]);\n\n React.useEffect(() => {\n if (open) {\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\n } else {\n setCurrentIndex(undefined);\n }\n }, [open]);\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n event.persist();\n\n if (listRef.current && event.relatedTarget === listRef.current) {\n event.preventDefault();\n return;\n }\n\n // event.target.value is always a string so it is important to cast value to a string before checking the equality\n if (onChange && event.target.value !== String(value)) {\n const item = findByValue(flattenedData, event.target.value);\n (event as any).detail = sanitizeItem(item);\n\n const parents = getOptionParents(flattenedData, item?.path);\n\n if (parents !== null && parents.length > 0) {\n (event as any).detail.parents = parents;\n }\n\n onChange(event);\n }\n\n if (props.onBlur) {\n props.onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInputValue(event.target.value);\n };\n\n const handleInputClick = (event: React.MouseEvent<HTMLInputElement>): void => {\n if (inline || (!open && inputValue && data.length)) {\n setOpen(true);\n }\n\n if (onClick) {\n event.persist();\n onClick(event);\n }\n };\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n event.persist();\n\n if (!event.ctrlKey && !event.metaKey) {\n switch (event.key) {\n case 'Backspace': {\n return;\n }\n\n case 'Escape': {\n event.preventDefault();\n setInputValue(convertToInputValue(value));\n setOpen(false);\n return;\n }\n\n case 'Tab':\n case 'Enter': {\n if (event.key !== 'Tab') {\n event.preventDefault();\n }\n\n setCurrentValue(currentIndex);\n setOpen(false);\n return;\n }\n\n case 'ArrowDown':\n if (open) {\n event.preventDefault();\n } else {\n if (!inline && buttonRef.current) {\n buttonRef.current.click();\n }\n }\n break;\n\n case 'ArrowUp':\n case 'Home':\n case 'End': {\n if (open) {\n event.preventDefault();\n }\n break;\n }\n\n default:\n }\n\n // we aren't focused on the list, so manually forward the keydown event to it\n if (listRef.current) {\n listRef.current.dispatchEvent(createCustomKeyboardEvent(event));\n }\n\n if (inline && !open) {\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n const initialIndex = event.key === 'ArrowUp' ? data.length - 1 : 0;\n setCurrentIndex(currentIndex !== undefined ? currentIndex : initialIndex);\n setOpen(true);\n }\n }\n }\n\n if (!event.isDefaultPrevented() && onKeyDown) {\n event.persist();\n onKeyDown(event);\n }\n };\n\n const handleListboxChange = (index: number): void => {\n setCurrentIndex(index);\n };\n\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>, index: number): void => {\n event.preventDefault();\n setCurrentValue(index);\n setOpen(false);\n };\n\n const combobox = {\n 'aria-expanded': open,\n 'aria-owns': listId,\n 'aria-haspopup': 'listbox' as const,\n role: 'combobox',\n };\n\n const input = {\n ...props,\n 'aria-controls': listId,\n // Indicates that the autocomplete behavior of the text input is to suggest a list of possible values in a popup and that the suggestions\n // are related to the string that is present in the textbox\n 'aria-autocomplete': 'list' as const,\n // Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the input element\n 'aria-activedescendant':\n currentIndex !== undefined && data[currentIndex] ? getId(listId, String(data[currentIndex].value)) : undefined,\n 'aria-labelledby': ariaLabelledBy,\n disabled,\n onBlur: !disabled && !readOnly ? handleInputBlur : undefined,\n onChange: !disabled && !readOnly ? handleInputChange : undefined,\n onClick: !disabled && !readOnly ? handleInputClick : undefined,\n onKeyDown: !disabled && !readOnly ? handleInputKeyDown : undefined,\n readOnly,\n ref: inputRef,\n type: 'text',\n value: inputValue ?? '',\n };\n\n const list: ScrollableListPropsWithRef = {\n 'aria-labelledby': ariaLabelledBy,\n data,\n disabled,\n id: listId,\n onChange: handleListboxChange,\n onClick: handleListboxClick,\n ref: listRef,\n scrollOnFocus: false,\n tabIndex: -1,\n value: currentIndex,\n };\n\n const button = {\n ref: buttonRef,\n };\n\n return {\n combobox,\n input,\n list,\n button,\n popover: {\n open,\n onOpenChange: setOpen,\n //visible: !data.length ? false : open,\n },\n };\n};\n"],"names":["debouncer","debounce","f","convertToInputValue","value","String","useCombobox","ariaLabel","ariaLabelledBy","data","unfilteredData","defaultValue","disabled","id","nativeId","inline","loading","__","onChange","onClick","onKeyDown","onSearch","readOnly","props","ref","inputRef","useMergedRef","buttonRef","React","listRef","open","setOpen","listId","uuid","inputValue","setInputValue","shouldFilterData","flattenedData","useFlattenedData","filterData","currentIndex","setCurrentIndex","undefined","getIndexFromValue","setInputValueByIndex","index","option","setInputValueByRef","current","setCurrentValue","isCurrentValue","length","handleInputBlur","event","persist","relatedTarget","preventDefault","target","item","findByValue","detail","sanitizeItem","parents","getOptionParents","path","onBlur","handleInputChange","handleInputClick","handleInputKeyDown","ctrlKey","metaKey","key","click","dispatchEvent","createCustomKeyboardEvent","initialIndex","isDefaultPrevented","handleListboxChange","handleListboxClick","combobox","role","input","getId","type","list","scrollOnFocus","tabIndex","button","popover","onOpenChange"],"mappings":";;;;;;;;AAkBA,MAAMA,SAAS,gBAAGC,QAAQ,CAACC,CAAC,IAAIA,CAAC,EAAE,EAAE,GAAG,CAAC;AAEzC,MAAMC,mBAAmB,GAAIC,KAA0C,IAAKC,MAAM,CAACD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,CAAC;MAUlFE,WAAW,GAAGA,CACvB;EACI,YAAY,EAAEC,SAAS;EACvB,iBAAiB,EAAEC,cAAc;EACjCC,IAAI,EAAEC,cAAc,GAAG,EAAE;EACzBC,YAAY;EACZC,QAAQ;EACRC,EAAE,EAAEC,QAAQ;EACZC,MAAM;EACNC,OAAO,EAAEC,EAAE;EACXC,QAAQ;EACRC,OAAO;EACPC,SAAS;EACTC,QAAQ;EACRC,QAAQ;EACRlB,KAAK;EACL,GAAGmB;CACyB,EAChCC,GAAgC;EAEhC,MAAMC,QAAQ,GAAGC,YAAY,CAAmBF,GAAG,CAAC;EACpD,MAAMG,SAAS,GAAGC,MAAY,CAAoB,IAAI,CAAC;EACvD,MAAMC,OAAO,GAAGD,MAAY,CAAmB,IAAI,CAAC;EACpD,MAAM,CAACE,IAAI,EAAEC,OAAO,CAAC,GAAGH,QAAc,CAAC,KAAK,CAAC;EAC7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EAAEC,QAAQ;IACb0D,IAAI,EAAE,MAAM;IACZ/E,KAAK,EAAE8B,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI;GACxB;EAED,MAAMkD,IAAI,GAA+B;IACrC,iBAAiB,EAAE5E,cAAc;IACjCC,IAAI;IACJG,QAAQ;IACRC,EAAE,EAAEmB,MAAM;IACVd,QAAQ,EAAE2D,mBAAmB;IAC7B1D,OAAO,EAAE2D,kBAAkB;IAC3BtD,GAAG,EAAEK,OAAO;IACZwD,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,CAAC,CAAC;IACZlF,KAAK,EAAEoC;GACV;EAED,MAAM+C,MAAM,GAAG;IACX/D,GAAG,EAAEG;GACR;EAED,OAAO;IACHoD,QAAQ;IACRE,KAAK;IACLG,IAAI;IACJG,MAAM;IACNC,OAAO,EAAE;MACL1D,IAAI;MACJ2D,YAAY,EAAE1D;;GAGrB;AACL;;;;"}
|
@@ -32,7 +32,7 @@ const useDatepicker = ({
|
|
32
32
|
// event handlers
|
33
33
|
const handleInputBlur = event => {
|
34
34
|
event.persist();
|
35
|
-
const valueAsDate = parseFromCustomString(event.target.value, 'dd.mm.yy', value === null || value === void 0 ? void 0 : value.getFullYear());
|
35
|
+
const valueAsDate = parseFromCustomString(event.target.value, 'dd.mm.yy', value === null || value === void 0 ? void 0 : value.getMonth(), value === null || value === void 0 ? void 0 : value.getFullYear());
|
36
36
|
const formattedValue = valueAsDate ? format(valueAsDate) || '' : '';
|
37
37
|
event.target.value = formattedValue;
|
38
38
|
if (onChange) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useDatepicker.js","sources":["../../../../../../../src/components/Datepicker/useDatepicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { parseFromCustomString, format } from '../../utils/date';\nimport { useLocalization } from '../Provider/Localization';\nimport { setInputValueByRef } from '../../utils/input';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { DatepickerProps } from './Datepicker';\nimport { CalendarProps } from '../Calendar/Calendar';\nimport { InputProps as BaseInputProps } from '../Input/Input';\nimport { isValid } from 'date-fns';\n\ntype InputProps = BaseInputProps & { ref: React.RefObject<HTMLInputElement> };\ntype useDatepicker = React.HTMLAttributes<HTMLDivElement> & {\n calendar: CalendarProps;\n input: InputProps;\n};\n\nexport const useDatepicker = (\n { defaultValue: _, calendar, onBlur, onChange, value, ...props }: DatepickerProps,\n ref: React.Ref<HTMLInputElement>\n): useDatepicker => {\n const inputRef = useMergedRef<HTMLInputElement>(ref);\n const { formatting } = useLocalization();\n const [internalValue, setInternalValue] = React.useState(value && isValid(value) ? format(value, formatting.date) : '');\n\n // update internal value if it changed 'externally'\n React.useEffect(() => {\n if (value && isValid(value)) {\n const formattedValue = format(value, formatting.date);\n\n if (formattedValue !== internalValue) {\n setInternalValue(formattedValue);\n }\n } else {\n setInternalValue('');\n }\n }, [value]);\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n event.persist();\n\n const valueAsDate = parseFromCustomString(event.target.value, 'dd.mm.yy', value?.getFullYear());\n const formattedValue = valueAsDate ? format(valueAsDate) || '' : '';\n\n event.target.value = formattedValue;\n\n if (onChange) {\n (event as any).detail = valueAsDate;\n onChange(event);\n } else {\n // update the internal value to use the formatted date\n setInternalValue(formattedValue);\n }\n\n if (onBlur) {\n onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInternalValue(event.target.value);\n };\n\n const handleChange = date => {\n setInputValueByRef(inputRef.current, format(date, formatting.date), 'focusout');\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (props.onKeyDown) {\n props.onKeyDown(event);\n }\n\n if (!event.isPropagationStopped() && !event.isDefaultPrevented() && event.key === 'Enter') {\n event.target.dispatchEvent(new Event('focusout', { bubbles: true }));\n }\n };\n\n const inputProps: InputProps = {\n ...props,\n autoComplete: 'off',\n onBlur: handleInputBlur,\n onChange: handleInputChange,\n onKeyDown: handleKeyDown,\n ref: inputRef,\n type: 'text',\n value: internalValue,\n };\n\n const calendarProps: CalendarProps = {\n ...calendar,\n onChange: handleChange,\n value,\n };\n\n return {\n input: inputProps,\n calendar: calendarProps,\n };\n};\n"],"names":["useDatepicker","defaultValue","_","calendar","onBlur","onChange","value","props","ref","inputRef","useMergedRef","formatting","useLocalization","internalValue","setInternalValue","React","isValid","format","date","formattedValue","handleInputBlur","event","persist","valueAsDate","parseFromCustomString","target","getFullYear","detail","handleInputChange","handleChange","setInputValueByRef","current","handleKeyDown","onKeyDown","isPropagationStopped","isDefaultPrevented","key","dispatchEvent","Event","bubbles","inputProps","autoComplete","type","calendarProps","input"],"mappings":";;;;;;;MAgBaA,aAAa,GAAGA,CACzB;EAAEC,YAAY,EAAEC,CAAC;EAAEC,QAAQ;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;CAAwB,EACjFC,GAAgC;EAEhC,MAAMC,QAAQ,GAAGC,YAAY,CAAmBF,GAAG,CAAC;EACpD,MAAM;IAAEG;GAAY,GAAGC,eAAe,EAAE;EACxC,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGC,QAAc,CAACT,KAAK,IAAIU,OAAO,CAACV,KAAK,CAAC,GAAGW,MAAM,CAACX,KAAK,EAAEK,UAAU,CAACO,IAAI,CAAC,GAAG,EAAE,CAAC;;EAGvHH,SAAe,CAAC;IACZ,IAAIT,KAAK,IAAIU,OAAO,CAACV,KAAK,CAAC,EAAE;MACzB,MAAMa,cAAc,GAAGF,MAAM,CAACX,KAAK,EAAEK,UAAU,CAACO,IAAI,CAAC;MAErD,IAAIC,cAAc,KAAKN,aAAa,EAAE;QAClCC,gBAAgB,CAACK,cAAc,CAAC;;KAEvC,MAAM;MACHL,gBAAgB,CAAC,EAAE,CAAC;;GAE3B,EAAE,CAACR,KAAK,CAAC,CAAC;;EAGX,MAAMc,eAAe,GAAIC,KAAyC;IAC9DA,KAAK,CAACC,OAAO,EAAE;IAEf,MAAMC,WAAW,GAAGC,qBAAqB,CAACH,KAAK,CAACI,MAAM,CAACnB,KAAK,EAAE,UAAU,EAAEA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEoB,WAAW,EAAE,CAAC;
|
1
|
+
{"version":3,"file":"useDatepicker.js","sources":["../../../../../../../src/components/Datepicker/useDatepicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { parseFromCustomString, format } from '../../utils/date';\nimport { useLocalization } from '../Provider/Localization';\nimport { setInputValueByRef } from '../../utils/input';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { DatepickerProps } from './Datepicker';\nimport { CalendarProps } from '../Calendar/Calendar';\nimport { InputProps as BaseInputProps } from '../Input/Input';\nimport { isValid } from 'date-fns';\n\ntype InputProps = BaseInputProps & { ref: React.RefObject<HTMLInputElement> };\ntype useDatepicker = React.HTMLAttributes<HTMLDivElement> & {\n calendar: CalendarProps;\n input: InputProps;\n};\n\nexport const useDatepicker = (\n { defaultValue: _, calendar, onBlur, onChange, value, ...props }: DatepickerProps,\n ref: React.Ref<HTMLInputElement>\n): useDatepicker => {\n const inputRef = useMergedRef<HTMLInputElement>(ref);\n const { formatting } = useLocalization();\n const [internalValue, setInternalValue] = React.useState(value && isValid(value) ? format(value, formatting.date) : '');\n\n // update internal value if it changed 'externally'\n React.useEffect(() => {\n if (value && isValid(value)) {\n const formattedValue = format(value, formatting.date);\n\n if (formattedValue !== internalValue) {\n setInternalValue(formattedValue);\n }\n } else {\n setInternalValue('');\n }\n }, [value]);\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n event.persist();\n\n const valueAsDate = parseFromCustomString(event.target.value, 'dd.mm.yy', value?.getMonth(), value?.getFullYear());\n const formattedValue = valueAsDate ? format(valueAsDate) || '' : '';\n\n event.target.value = formattedValue;\n\n if (onChange) {\n (event as any).detail = valueAsDate;\n onChange(event);\n } else {\n // update the internal value to use the formatted date\n setInternalValue(formattedValue);\n }\n\n if (onBlur) {\n onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInternalValue(event.target.value);\n };\n\n const handleChange = date => {\n setInputValueByRef(inputRef.current, format(date, formatting.date), 'focusout');\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (props.onKeyDown) {\n props.onKeyDown(event);\n }\n\n if (!event.isPropagationStopped() && !event.isDefaultPrevented() && event.key === 'Enter') {\n event.target.dispatchEvent(new Event('focusout', { bubbles: true }));\n }\n };\n\n const inputProps: InputProps = {\n ...props,\n autoComplete: 'off',\n onBlur: handleInputBlur,\n onChange: handleInputChange,\n onKeyDown: handleKeyDown,\n ref: inputRef,\n type: 'text',\n value: internalValue,\n };\n\n const calendarProps: CalendarProps = {\n ...calendar,\n onChange: handleChange,\n value,\n };\n\n return {\n input: inputProps,\n calendar: calendarProps,\n };\n};\n"],"names":["useDatepicker","defaultValue","_","calendar","onBlur","onChange","value","props","ref","inputRef","useMergedRef","formatting","useLocalization","internalValue","setInternalValue","React","isValid","format","date","formattedValue","handleInputBlur","event","persist","valueAsDate","parseFromCustomString","target","getMonth","getFullYear","detail","handleInputChange","handleChange","setInputValueByRef","current","handleKeyDown","onKeyDown","isPropagationStopped","isDefaultPrevented","key","dispatchEvent","Event","bubbles","inputProps","autoComplete","type","calendarProps","input"],"mappings":";;;;;;;MAgBaA,aAAa,GAAGA,CACzB;EAAEC,YAAY,EAAEC,CAAC;EAAEC,QAAQ;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;CAAwB,EACjFC,GAAgC;EAEhC,MAAMC,QAAQ,GAAGC,YAAY,CAAmBF,GAAG,CAAC;EACpD,MAAM;IAAEG;GAAY,GAAGC,eAAe,EAAE;EACxC,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGC,QAAc,CAACT,KAAK,IAAIU,OAAO,CAACV,KAAK,CAAC,GAAGW,MAAM,CAACX,KAAK,EAAE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U,CAAC;GAClF;EAED,MAAMe,aAAa,GAAIZ,KAA4C;IAC/D,IAAId,KAAK,CAAC2B,SAAS,EAAE;MACjB3B,KAAK,CAAC2B,SAAS,CAACb,KAAK,CAAC;;IAG1B,IAAI,CAACA,KAAK,CAACc,oBAAoB,EAAE,IAAI,CAACd,KAAK,CAACe,kBAAkB,EAAE,IAAIf,KAAK,CAACgB,GAAG,KAAK,OAAO,EAAE;MACvFhB,KAAK,CAACI,MAAM,CAACa,aAAa,CAAC,IAAIC,KAAK,CAAC,UAAU,EAAE;QAAEC,OAAO,EAAE;OAAM,CAAC,CAAC;;GAE3E;EAED,MAAMC,UAAU,GAAe;IAC3B,GAAGlC,KAAK;IACRmC,YAAY,EAAE,KAAK;IACnBtC,MAAM,EAAEgB,eAAe;IACvBf,QAAQ,EAAEwB,iBAAiB;IAC3BK,SAAS,EAAED,aAAa;IACxBzB,GAAG,EAAEC,QAAQ;IACbkC,IAAI,EAAE,MAAM;IACZrC,KAAK,EAAEO;GACV;EAED,MAAM+B,aAAa,GAAkB;IACjC,GAAGzC,QAAQ;IACXE,QAAQ,EAAEyB,YAAY;IACtBxB;GACH;EAED,OAAO;IACHuC,KAAK,EAAEJ,UAAU;IACjBtC,QAAQ,EAAEyC;GACb;AACL;;;;"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { forwardRef, createElement } from 'react';
|
2
|
+
|
3
|
+
function IconPhone(props, svgRef) {
|
4
|
+
return /*#__PURE__*/createElement("svg", Object.assign({
|
5
|
+
fill: "none",
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
7
|
+
viewBox: "0 0 24 24",
|
8
|
+
ref: svgRef
|
9
|
+
}, props), /*#__PURE__*/createElement("path", {
|
10
|
+
d: "M4.742 3.998l1.036-.641a2.75 2.75 0 013.58.6l1.39 1.703a2.75 2.75 0 01.2 3.196l-1.082 1.732a.25.25 0 00-.035.17c.06.396.52 1.073 1.397 1.95.638.638 1.174 1.062 1.59 1.27.289.144.43.154.48.123l1.783-1.114a2.75 2.75 0 013.195.201l1.696 1.383a2.75 2.75 0 01.606 3.57l-.639 1.04a3.75 3.75 0 01-3.234 1.788c-2.86-.03-5.846-1.636-8.974-4.763-3.133-3.133-4.739-6.124-4.764-8.986a3.75 3.75 0 011.775-3.222zm.79 1.276a2.25 2.25 0 00-1.065 1.932c.021 2.408 1.445 5.06 4.324 7.939 2.876 2.876 5.524 4.3 7.93 4.324a2.25 2.25 0 001.94-1.072l.639-1.04a1.25 1.25 0 00-.276-1.623l-1.696-1.383a1.25 1.25 0 00-1.452-.092l-1.787 1.117c-1.04.64-2.31.005-3.922-1.607-1.086-1.087-1.698-1.988-1.82-2.786a1.75 1.75 0 01.247-1.19l1.083-1.732a1.25 1.25 0 00-.092-1.453l-1.39-1.704a1.25 1.25 0 00-1.627-.272l-1.036.642z",
|
11
|
+
fill: "currentColor"
|
12
|
+
}));
|
13
|
+
}
|
14
|
+
var Phone = /*#__PURE__*/forwardRef(IconPhone);
|
15
|
+
|
16
|
+
export default Phone;
|
17
|
+
//# sourceMappingURL=Phone.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Phone.js","sources":["../../../../../../../../src/components/Icon/components/Phone.tsx"],"sourcesContent":["import * as React from 'react';\nfunction IconPhone(props: React.SVGProps<SVGSVGElement>, svgRef?: React.Ref<SVGSVGElement>): JSX.Element {\n return (\n <svg fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" ref={svgRef} {...props}>\n <path\n d=\"M4.742 3.998l1.036-.641a2.75 2.75 0 013.58.6l1.39 1.703a2.75 2.75 0 01.2 3.196l-1.082 1.732a.25.25 0 00-.035.17c.06.396.52 1.073 1.397 1.95.638.638 1.174 1.062 1.59 1.27.289.144.43.154.48.123l1.783-1.114a2.75 2.75 0 013.195.201l1.696 1.383a2.75 2.75 0 01.606 3.57l-.639 1.04a3.75 3.75 0 01-3.234 1.788c-2.86-.03-5.846-1.636-8.974-4.763-3.133-3.133-4.739-6.124-4.764-8.986a3.75 3.75 0 011.775-3.222zm.79 1.276a2.25 2.25 0 00-1.065 1.932c.021 2.408 1.445 5.06 4.324 7.939 2.876 2.876 5.524 4.3 7.93 4.324a2.25 2.25 0 001.94-1.072l.639-1.04a1.25 1.25 0 00-.276-1.623l-1.696-1.383a1.25 1.25 0 00-1.452-.092l-1.787 1.117c-1.04.64-2.31.005-3.922-1.607-1.086-1.087-1.698-1.988-1.82-2.786a1.75 1.75 0 01.247-1.19l1.083-1.732a1.25 1.25 0 00-.092-1.453l-1.39-1.704a1.25 1.25 0 00-1.627-.272l-1.036.642z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\nexport default React.forwardRef(IconPhone);\n"],"names":["IconPhone","props","svgRef","React","fill","xmlns","viewBox","ref","d"],"mappings":";;AACA,SAASA,SAASA,CAACC,KAAoC,EAAEC,MAAiC;EACtF,oBACIC;IAAKC,IAAI,EAAC,MAAM;IAACC,KAAK,EAAC,4BAA4B;IAACC,OAAO,EAAC,WAAW;IAACC,GAAG,EAAEL;KAAYD,KAAK,gBAC1FE;IACIK,CAAC,EAAC,0xBAA0xB;IAC5xBJ,IAAI,EAAC;IACP,CACA;AAEd;AACA,yBAAeD,UAAgB,CAACH,SAAS,CAAC;;;;"}
|
@@ -179,6 +179,7 @@ import PersonMinus from './PersonMinus.js';
|
|
179
179
|
import PersonPlus from './PersonPlus.js';
|
180
180
|
import PersonTick from './PersonTick.js';
|
181
181
|
import PhoneSolid from './PhoneSolid.js';
|
182
|
+
import Phone from './Phone.js';
|
182
183
|
import Play from './Play.js';
|
183
184
|
import PlusMinus from './PlusMinus.js';
|
184
185
|
import Print from './Print.js';
|
@@ -424,6 +425,7 @@ const icons = {
|
|
424
425
|
'person-plus': PersonPlus,
|
425
426
|
'person-tick': PersonTick,
|
426
427
|
'phone-solid': PhoneSolid,
|
428
|
+
phone: Phone,
|
427
429
|
play: Play,
|
428
430
|
'plus-minus': PlusMinus,
|
429
431
|
print: Print,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../../src/components/Icon/components/index.tsx"],"sourcesContent":["import AccountPreview from './AccountPreview';\nimport AccountingYearCancel from './AccountingYearCancel';\nimport AccountingYear from './AccountingYear';\nimport Accounting from './Accounting';\nimport AiChatSolid from './AiChatSolid';\nimport AiStars from './AiStars';\nimport ArrowBottom from './ArrowBottom';\nimport ArrowDown from './ArrowDown';\nimport ArrowEnd from './ArrowEnd';\nimport ArrowLeft from './ArrowLeft';\nimport ArrowRight from './ArrowRight';\nimport ArrowStart from './ArrowStart';\nimport ArrowTop from './ArrowTop';\nimport ArrowUp from './ArrowUp';\nimport AttachAuto from './AttachAuto';\nimport AttachCancel from './AttachCancel';\nimport AttachWarning from './AttachWarning';\nimport Attach from './Attach';\nimport AutotextInsert from './AutotextInsert';\nimport Autotext from './Autotext';\nimport BasicTabs from './BasicTabs';\nimport Basic from './Basic';\nimport BellSolid from './BellSolid';\nimport Book from './Book';\nimport Booking from './Booking';\nimport Budget from './Budget';\nimport Calendar from './Calendar';\nimport CashAccount from './CashAccount';\nimport CashReports from './CashReports';\nimport ChartArea from './ChartArea';\nimport ChartBar from './ChartBar';\nimport ChartLine from './ChartLine';\nimport ChartPie from './ChartPie';\nimport ChartTable from './ChartTable';\nimport ChatSolid from './ChatSolid';\nimport Chat from './Chat';\nimport ChevronDownDouble from './ChevronDownDouble';\nimport ChevronDownSolid from './ChevronDownSolid';\nimport ChevronDown from './ChevronDown';\nimport ChevronLeftDouble from './ChevronLeftDouble';\nimport ChevronLeftSolid from './ChevronLeftSolid';\nimport ChevronLeft from './ChevronLeft';\nimport ChevronRightDouble from './ChevronRightDouble';\nimport ChevronRightSolid from './ChevronRightSolid';\nimport ChevronRight from './ChevronRight';\nimport ChevronUpDouble from './ChevronUpDouble';\nimport ChevronUpSolid from './ChevronUpSolid';\nimport ChevronUp from './ChevronUp';\nimport CircleClose from './CircleClose';\nimport CircleInformation from './CircleInformation';\nimport CircleMinus from './CircleMinus';\nimport CirclePlus from './CirclePlus';\nimport CircleQuestionmark from './CircleQuestionmark';\nimport CircleTick from './CircleTick';\nimport CircleWarning from './CircleWarning';\nimport ClampOpen from './ClampOpen';\nimport Clamp from './Clamp';\nimport Close from './Close';\nimport ColumnFreeze from './ColumnFreeze';\nimport ColumnUnfreeze from './ColumnUnfreeze';\nimport Columns from './Columns';\nimport ConnectionEnable from './ConnectionEnable';\nimport ConnectionRevoke from './ConnectionRevoke';\nimport Contacts from './Contacts';\nimport Copy from './Copy';\nimport Courses from './Courses';\nimport Credit from './Credit';\nimport DeletePermanently from './DeletePermanently';\nimport Delete from './Delete';\nimport Depecriate from './Depecriate';\nimport Developer from './Developer';\nimport DistributionTemplate from './DistributionTemplate';\nimport DocumentApprove from './DocumentApprove';\nimport DocumentCreateEntry from './DocumentCreateEntry';\nimport DocumentCut from './DocumentCut';\nimport DocumentError from './DocumentError';\nimport DocumentIsolatePage from './DocumentIsolatePage';\nimport DocumentMerge from './DocumentMerge';\nimport DocumentMove from './DocumentMove';\nimport DocumentPreview from './DocumentPreview';\nimport DocumentReceived from './DocumentReceived';\nimport DocumentRejectedRequest from './DocumentRejectedRequest';\nimport DocumentSplit from './DocumentSplit';\nimport DocumentTime from './DocumentTime';\nimport Document from './Document';\nimport Download from './Download';\nimport Drag from './Drag';\nimport ECopedia from './ECopedia';\nimport ESignature from './ESignature';\nimport EditSimple from './EditSimple';\nimport Edit from './Edit';\nimport EllipsisHorizontal from './EllipsisHorizontal';\nimport EllipsisVertical from './EllipsisVertical';\nimport EntriesOnAccount from './EntriesOnAccount';\nimport EntriesOpen from './EntriesOpen';\nimport EntriesWarning from './EntriesWarning';\nimport EntryTypeCustomerInvoice from './EntryTypeCustomerInvoice';\nimport EntryTypeCustomerPayment from './EntryTypeCustomerPayment';\nimport EntryTypeJournalEntry from './EntryTypeJournalEntry';\nimport EntryTypeManualCustomerInvoice from './EntryTypeManualCustomerInvoice';\nimport EntryTypeSupplierInvoice from './EntryTypeSupplierInvoice';\nimport EntryTypeSupplierPayment from './EntryTypeSupplierPayment';\nimport EnvelopeApproved from './EnvelopeApproved';\nimport EnvelopeSolid from './EnvelopeSolid';\nimport Envelope from './Envelope';\nimport ExpandView from './ExpandView';\nimport Expenses from './Expenses';\nimport ExportToExcel from './ExportToExcel';\nimport ExportToPdf from './ExportToPdf';\nimport Export from './Export';\nimport EyeOff from './EyeOff';\nimport EyeOn from './EyeOn';\nimport FilterSolid from './FilterSolid';\nimport Filter from './Filter';\nimport FontSize from './FontSize';\nimport GraphSolid from './GraphSolid';\nimport Hash from './Hash';\nimport HeightExtraTall from './HeightExtraTall';\nimport HeightMedium from './HeightMedium';\nimport HeightShort from './HeightShort';\nimport HeightTall from './HeightTall';\nimport Home from './Home';\nimport Images from './Images';\nimport Import from './Import';\nimport InboxEinvoicing from './InboxEinvoicing';\nimport InboxScanning from './InboxScanning';\nimport InboxSmart from './InboxSmart';\nimport Inbox from './Inbox';\nimport Info from './Info';\nimport InventoryMatrix from './InventoryMatrix';\nimport Inventory from './Inventory';\nimport JournalPro from './JournalPro';\nimport LayoutBoth from './LayoutBoth';\nimport LayoutFirst from './LayoutFirst';\nimport LayoutLast from './LayoutLast';\nimport LayoutNone from './LayoutNone';\nimport Layout from './Layout';\nimport LedgerCardCustomerReminder from './LedgerCardCustomerReminder';\nimport LedgerCardManualCustomerInvoice from './LedgerCardManualCustomerInvoice';\nimport LedgerCardObsoleteStock from './LedgerCardObsoleteStock';\nimport LedgerCardOpeningEntry from './LedgerCardOpeningEntry';\nimport LedgerCardReservedEntry from './LedgerCardReservedEntry';\nimport LedgerCardShrinkagePilferage from './LedgerCardShrinkagePilferage';\nimport LedgerCardStockAdjustment from './LedgerCardStockAdjustment';\nimport LedgerCardTransferredOpeningEntry from './LedgerCardTransferredOpeningEntry';\nimport LedgerCard from './LedgerCard';\nimport Lightbulb from './Lightbulb';\nimport Line from './Line';\nimport LinkExternal from './LinkExternal';\nimport ListBulleted from './ListBulleted';\nimport ListSearch from './ListSearch';\nimport List from './List';\nimport Location from './Location';\nimport LockOpen from './LockOpen';\nimport Lock from './Lock';\nimport LogOut from './LogOut';\nimport Log from './Log';\nimport Market from './Market';\nimport MatchAmount from './MatchAmount';\nimport MatchEntries from './MatchEntries';\nimport Menu from './Menu';\nimport Mileage from './Mileage';\nimport ModalResize from './ModalResize';\nimport ModalShrink from './ModalShrink';\nimport MoreSolid from './MoreSolid';\nimport More from './More';\nimport Move from './Move';\nimport NavigationList from './NavigationList';\nimport NoteFollowUp from './NoteFollowUp';\nimport NoteRead from './NoteRead';\nimport Note from './Note';\nimport Numbers from './Numbers';\nimport PartnerApi from './PartnerApi';\nimport PaymentPaid from './PaymentPaid';\nimport PaymentUnpaid from './PaymentUnpaid';\nimport Period from './Period';\nimport PersonChange from './PersonChange';\nimport PersonMinus from './PersonMinus';\nimport PersonPlus from './PersonPlus';\nimport PersonTick from './PersonTick';\nimport PhoneSolid from './PhoneSolid';\nimport Play from './Play';\nimport PlusMinus from './PlusMinus';\nimport Print from './Print';\nimport ProcessPayment from './ProcessPayment';\nimport ProductLedgerCard from './ProductLedgerCard';\nimport Profile from './Profile';\nimport ProjectCards from './ProjectCards';\nimport Projects from './Projects';\nimport QuestionMarkBold from './QuestionMarkBold';\nimport QuestionMark from './QuestionMark';\nimport Quicklinks from './Quicklinks';\nimport RatingBankruptcy from './RatingBankruptcy';\nimport RatingPaymentProblems from './RatingPaymentProblems';\nimport Reconciled from './Reconciled';\nimport Refresh from './Refresh';\nimport ReportSolid from './ReportSolid';\nimport Report from './Report';\nimport Restore from './Restore';\nimport RotateLeft from './RotateLeft';\nimport RotateRight from './RotateRight';\nimport Sales from './Sales';\nimport SearchBold from './SearchBold';\nimport Search from './Search';\nimport SecureTick from './SecureTick';\nimport Secure from './Secure';\nimport SettingsSolid from './SettingsSolid';\nimport Settings from './Settings';\nimport Shortcuts from './Shortcuts';\nimport ShowAll from './ShowAll';\nimport ShowLess from './ShowLess';\nimport ShowMore from './ShowMore';\nimport ShowTemplate from './ShowTemplate';\nimport Sliders from './Sliders';\nimport Smartpay from './Smartpay';\nimport SortBy from './SortBy';\nimport StarSolid from './StarSolid';\nimport Star from './Star';\nimport Subscriptions from './Subscriptions';\nimport SystemEntries from './SystemEntries';\nimport Tag from './Tag';\nimport TemplateOverride from './TemplateOverride';\nimport Templates from './Templates';\nimport ThumbBoth from './ThumbBoth';\nimport ThumbDownSolid from './ThumbDownSolid';\nimport ThumbDown from './ThumbDown';\nimport ThumbUpSolid from './ThumbUpSolid';\nimport ThumbUp from './ThumbUp';\nimport TickBold from './TickBold';\nimport Tick from './Tick';\nimport Time from './Time';\nimport TransferCancel from './TransferCancel';\nimport TransferLocked from './TransferLocked';\nimport Transfer from './Transfer';\nimport Undo from './Undo';\nimport Undock from './Undock';\nimport Unreconciled from './Unreconciled';\nimport Warning from './Warning';\nimport Webshop from './Webshop';\nimport Website from './Website';\nimport WorkflowTemplateBasic from './WorkflowTemplateBasic';\nimport Workflow from './Workflow';\nimport Zoom from './Zoom';\n\nexport const icons: Record<\n IconName,\n React.ForwardRefExoticComponent<React.SVGAttributes<SVGSVGElement> & React.RefAttributes<SVGSVGElement>>\n> = {\n 'account-preview': AccountPreview,\n 'accounting-year-cancel': AccountingYearCancel,\n 'accounting-year': AccountingYear,\n accounting: Accounting,\n 'ai-chat-solid': AiChatSolid,\n 'ai-stars': AiStars,\n 'arrow-bottom': ArrowBottom,\n 'arrow-down': ArrowDown,\n 'arrow-end': ArrowEnd,\n 'arrow-left': ArrowLeft,\n 'arrow-right': ArrowRight,\n 'arrow-start': ArrowStart,\n 'arrow-top': ArrowTop,\n 'arrow-up': ArrowUp,\n 'attach-auto': AttachAuto,\n 'attach-cancel': AttachCancel,\n 'attach-warning': AttachWarning,\n attach: Attach,\n 'autotext-insert': AutotextInsert,\n autotext: Autotext,\n 'basic-tabs': BasicTabs,\n basic: Basic,\n 'bell-solid': BellSolid,\n book: Book,\n booking: Booking,\n budget: Budget,\n calendar: Calendar,\n 'cash-account': CashAccount,\n 'cash-reports': CashReports,\n 'chart-area': ChartArea,\n 'chart-bar': ChartBar,\n 'chart-line': ChartLine,\n 'chart-pie': ChartPie,\n 'chart-table': ChartTable,\n 'chat-solid': ChatSolid,\n chat: Chat,\n 'chevron-down-double': ChevronDownDouble,\n 'chevron-down-solid': ChevronDownSolid,\n 'chevron-down': ChevronDown,\n 'chevron-left-double': ChevronLeftDouble,\n 'chevron-left-solid': ChevronLeftSolid,\n 'chevron-left': ChevronLeft,\n 'chevron-right-double': ChevronRightDouble,\n 'chevron-right-solid': ChevronRightSolid,\n 'chevron-right': ChevronRight,\n 'chevron-up-double': ChevronUpDouble,\n 'chevron-up-solid': ChevronUpSolid,\n 'chevron-up': ChevronUp,\n 'circle-close': CircleClose,\n 'circle-information': CircleInformation,\n 'circle-minus': CircleMinus,\n 'circle-plus': CirclePlus,\n 'circle-questionmark': CircleQuestionmark,\n 'circle-tick': CircleTick,\n 'circle-warning': CircleWarning,\n 'clamp-open': ClampOpen,\n clamp: Clamp,\n close: Close,\n 'column-freeze': ColumnFreeze,\n 'column-unfreeze': ColumnUnfreeze,\n columns: Columns,\n 'connection-enable': ConnectionEnable,\n 'connection-revoke': ConnectionRevoke,\n contacts: Contacts,\n copy: Copy,\n courses: Courses,\n credit: Credit,\n 'delete-permanently': DeletePermanently,\n delete: Delete,\n depecriate: Depecriate,\n developer: Developer,\n 'distribution-template': DistributionTemplate,\n 'document-approve': DocumentApprove,\n 'document-create-entry': DocumentCreateEntry,\n 'document-cut': DocumentCut,\n 'document-error': DocumentError,\n 'document-isolate-page': DocumentIsolatePage,\n 'document-merge': DocumentMerge,\n 'document-move': DocumentMove,\n 'document-preview': DocumentPreview,\n 'document-received': DocumentReceived,\n 'document-rejected-request': DocumentRejectedRequest,\n 'document-split': DocumentSplit,\n 'document-time': DocumentTime,\n document: Document,\n download: Download,\n drag: Drag,\n 'e-copedia': ECopedia,\n 'e-signature': ESignature,\n 'edit-simple': EditSimple,\n edit: Edit,\n 'ellipsis-horizontal': EllipsisHorizontal,\n 'ellipsis-vertical': EllipsisVertical,\n 'entries-on-account': EntriesOnAccount,\n 'entries-open': EntriesOpen,\n 'entries-warning': EntriesWarning,\n 'entry-type-customer-invoice': EntryTypeCustomerInvoice,\n 'entry-type-customer-payment': EntryTypeCustomerPayment,\n 'entry-type-journal-entry': EntryTypeJournalEntry,\n 'entry-type-manual-customer-invoice': EntryTypeManualCustomerInvoice,\n 'entry-type-supplier-invoice': EntryTypeSupplierInvoice,\n 'entry-type-supplier-payment': EntryTypeSupplierPayment,\n 'envelope-approved': EnvelopeApproved,\n 'envelope-solid': EnvelopeSolid,\n envelope: Envelope,\n 'expand-view': ExpandView,\n expenses: Expenses,\n 'export-to-excel': ExportToExcel,\n 'export-to-pdf': ExportToPdf,\n export: Export,\n 'eye-off': EyeOff,\n 'eye-on': EyeOn,\n 'filter-solid': FilterSolid,\n filter: Filter,\n 'font-size': FontSize,\n 'graph-solid': GraphSolid,\n hash: Hash,\n 'height-extra-tall': HeightExtraTall,\n 'height-medium': HeightMedium,\n 'height-short': HeightShort,\n 'height-tall': HeightTall,\n home: Home,\n images: Images,\n import: Import,\n 'inbox-einvoicing': InboxEinvoicing,\n 'inbox-scanning': InboxScanning,\n 'inbox-smart': InboxSmart,\n inbox: Inbox,\n info: Info,\n 'inventory-matrix': InventoryMatrix,\n inventory: Inventory,\n 'journal-pro': JournalPro,\n 'layout-both': LayoutBoth,\n 'layout-first': LayoutFirst,\n 'layout-last': LayoutLast,\n 'layout-none': LayoutNone,\n layout: Layout,\n 'ledger-card-customer-reminder': LedgerCardCustomerReminder,\n 'ledger-card-manual-customer-invoice': LedgerCardManualCustomerInvoice,\n 'ledger-card-obsolete-stock': LedgerCardObsoleteStock,\n 'ledger-card-opening-entry': LedgerCardOpeningEntry,\n 'ledger-card-reserved-entry': LedgerCardReservedEntry,\n 'ledger-card-shrinkage-pilferage': LedgerCardShrinkagePilferage,\n 'ledger-card-stock-adjustment': LedgerCardStockAdjustment,\n 'ledger-card-transferred-opening-entry': LedgerCardTransferredOpeningEntry,\n 'ledger-card': LedgerCard,\n lightbulb: Lightbulb,\n line: Line,\n 'link-external': LinkExternal,\n 'list-bulleted': ListBulleted,\n 'list-search': ListSearch,\n list: List,\n location: Location,\n 'lock-open': LockOpen,\n lock: Lock,\n 'log-out': LogOut,\n log: Log,\n market: Market,\n 'match-amount': MatchAmount,\n 'match-entries': MatchEntries,\n menu: Menu,\n mileage: Mileage,\n 'modal-resize': ModalResize,\n 'modal-shrink': ModalShrink,\n 'more-solid': MoreSolid,\n more: More,\n move: Move,\n 'navigation-list': NavigationList,\n 'note-follow-up': NoteFollowUp,\n 'note-read': NoteRead,\n note: Note,\n numbers: Numbers,\n 'partner-api': PartnerApi,\n 'payment-paid': PaymentPaid,\n 'payment-unpaid': PaymentUnpaid,\n period: Period,\n 'person-change': PersonChange,\n 'person-minus': PersonMinus,\n 'person-plus': PersonPlus,\n 'person-tick': PersonTick,\n 'phone-solid': PhoneSolid,\n play: Play,\n 'plus-minus': PlusMinus,\n print: Print,\n 'process-payment': ProcessPayment,\n 'product-ledger-card': ProductLedgerCard,\n profile: Profile,\n 'project-cards': ProjectCards,\n projects: Projects,\n 'question-mark-bold': QuestionMarkBold,\n 'question-mark': QuestionMark,\n quicklinks: Quicklinks,\n 'rating-bankruptcy': RatingBankruptcy,\n 'rating-payment-problems': RatingPaymentProblems,\n reconciled: Reconciled,\n refresh: Refresh,\n 'report-solid': ReportSolid,\n report: Report,\n restore: Restore,\n 'rotate-left': RotateLeft,\n 'rotate-right': RotateRight,\n sales: Sales,\n 'search-bold': SearchBold,\n search: Search,\n 'secure-tick': SecureTick,\n secure: Secure,\n 'settings-solid': SettingsSolid,\n settings: Settings,\n shortcuts: Shortcuts,\n 'show-all': ShowAll,\n 'show-less': ShowLess,\n 'show-more': ShowMore,\n 'show-template': ShowTemplate,\n sliders: Sliders,\n smartpay: Smartpay,\n 'sort-by': SortBy,\n 'star-solid': StarSolid,\n star: Star,\n subscriptions: Subscriptions,\n 'system-entries': SystemEntries,\n tag: Tag,\n 'template-override': TemplateOverride,\n templates: Templates,\n 'thumb-both': ThumbBoth,\n 'thumb-down-solid': ThumbDownSolid,\n 'thumb-down': ThumbDown,\n 'thumb-up-solid': ThumbUpSolid,\n 'thumb-up': ThumbUp,\n 'tick-bold': TickBold,\n tick: Tick,\n time: Time,\n 'transfer-cancel': TransferCancel,\n 'transfer-locked': TransferLocked,\n transfer: Transfer,\n undo: Undo,\n undock: Undock,\n unreconciled: Unreconciled,\n warning: Warning,\n webshop: Webshop,\n website: Website,\n 'workflow-template-basic': WorkflowTemplateBasic,\n workflow: Workflow,\n zoom: Zoom,\n};\n\n// the prop extraction tool can't handle this\n//export type IconName = keyof typeof icons;\nexport type IconName =\n | 'account-preview'\n | 'accounting-year-cancel'\n | 'accounting-year'\n | 'accounting'\n | 'ai-chat-solid'\n | 'ai-stars'\n | 'arrow-bottom'\n | 'arrow-down'\n | 'arrow-end'\n | 'arrow-left'\n | 'arrow-right'\n | 'arrow-start'\n | 'arrow-top'\n | 'arrow-up'\n | 'attach-auto'\n | 'attach-cancel'\n | 'attach-warning'\n | 'attach'\n | 'autotext-insert'\n | 'autotext'\n | 'basic-tabs'\n | 'basic'\n | 'bell-solid'\n | 'book'\n | 'booking'\n | 'budget'\n | 'calendar'\n | 'cash-account'\n | 'cash-reports'\n | 'chart-area'\n | 'chart-bar'\n | 'chart-line'\n | 'chart-pie'\n | 'chart-table'\n | 'chat-solid'\n | 'chat'\n | 'chevron-down-double'\n | 'chevron-down-solid'\n | 'chevron-down'\n | 'chevron-left-double'\n | 'chevron-left-solid'\n | 'chevron-left'\n | 'chevron-right-double'\n | 'chevron-right-solid'\n | 'chevron-right'\n | 'chevron-up-double'\n | 'chevron-up-solid'\n | 'chevron-up'\n | 'circle-close'\n | 'circle-information'\n | 'circle-minus'\n | 'circle-plus'\n | 'circle-questionmark'\n | 'circle-tick'\n | 'circle-warning'\n | 'clamp-open'\n | 'clamp'\n | 'close'\n | 'column-freeze'\n | 'column-unfreeze'\n | 'columns'\n | 'connection-enable'\n | 'connection-revoke'\n | 'contacts'\n | 'copy'\n | 'courses'\n | 'credit'\n | 'delete-permanently'\n | 'delete'\n | 'depecriate'\n | 'developer'\n | 'distribution-template'\n | 'document-approve'\n | 'document-create-entry'\n | 'document-cut'\n | 'document-error'\n | 'document-isolate-page'\n | 'document-merge'\n | 'document-move'\n | 'document-preview'\n | 'document-received'\n | 'document-rejected-request'\n | 'document-split'\n | 'document-time'\n | 'document'\n | 'download'\n | 'drag'\n | 'e-copedia'\n | 'e-signature'\n | 'edit-simple'\n | 'edit'\n | 'ellipsis-horizontal'\n | 'ellipsis-vertical'\n | 'entries-on-account'\n | 'entries-open'\n | 'entries-warning'\n | 'entry-type-customer-invoice'\n | 'entry-type-customer-payment'\n | 'entry-type-journal-entry'\n | 'entry-type-manual-customer-invoice'\n | 'entry-type-supplier-invoice'\n | 'entry-type-supplier-payment'\n | 'envelope-approved'\n | 'envelope-solid'\n | 'envelope'\n | 'expand-view'\n | 'expenses'\n | 'export-to-excel'\n | 'export-to-pdf'\n | 'export'\n | 'eye-off'\n | 'eye-on'\n | 'filter-solid'\n | 'filter'\n | 'font-size'\n | 'graph-solid'\n | 'hash'\n | 'height-extra-tall'\n | 'height-medium'\n | 'height-short'\n | 'height-tall'\n | 'home'\n | 'images'\n | 'import'\n | 'inbox-einvoicing'\n | 'inbox-scanning'\n | 'inbox-smart'\n | 'inbox'\n | 'info'\n | 'inventory-matrix'\n | 'inventory'\n | 'journal-pro'\n | 'layout-both'\n | 'layout-first'\n | 'layout-last'\n | 'layout-none'\n | 'layout'\n | 'ledger-card-customer-reminder'\n | 'ledger-card-manual-customer-invoice'\n | 'ledger-card-obsolete-stock'\n | 'ledger-card-opening-entry'\n | 'ledger-card-reserved-entry'\n | 'ledger-card-shrinkage-pilferage'\n | 'ledger-card-stock-adjustment'\n | 'ledger-card-transferred-opening-entry'\n | 'ledger-card'\n | 'lightbulb'\n | 'line'\n | 'link-external'\n | 'list-bulleted'\n | 'list-search'\n | 'list'\n | 'location'\n | 'lock-open'\n | 'lock'\n | 'log-out'\n | 'log'\n | 'market'\n | 'match-amount'\n | 'match-entries'\n | 'menu'\n | 'mileage'\n | 'modal-resize'\n | 'modal-shrink'\n | 'more-solid'\n | 'more'\n | 'move'\n | 'navigation-list'\n | 'note-follow-up'\n | 'note-read'\n | 'note'\n | 'numbers'\n | 'partner-api'\n | 'payment-paid'\n | 'payment-unpaid'\n | 'period'\n | 'person-change'\n | 'person-minus'\n | 'person-plus'\n | 'person-tick'\n | 'phone-solid'\n | 'play'\n | 'plus-minus'\n | 'print'\n | 'process-payment'\n | 'product-ledger-card'\n | 'profile'\n | 'project-cards'\n | 'projects'\n | 'question-mark-bold'\n | 'question-mark'\n | 'quicklinks'\n | 'rating-bankruptcy'\n | 'rating-payment-problems'\n | 'reconciled'\n | 'refresh'\n | 'report-solid'\n | 'report'\n | 'restore'\n | 'rotate-left'\n | 'rotate-right'\n | 'sales'\n | 'search-bold'\n | 'search'\n | 'secure-tick'\n | 'secure'\n | 'settings-solid'\n | 'settings'\n | 'shortcuts'\n | 'show-all'\n | 'show-less'\n | 'show-more'\n | 'show-template'\n | 'sliders'\n | 'smartpay'\n | 'sort-by'\n | 'star-solid'\n | 'star'\n | 'subscriptions'\n | 'system-entries'\n | 'tag'\n | 'template-override'\n | 'templates'\n | 'thumb-both'\n | 'thumb-down-solid'\n | 'thumb-down'\n | 'thumb-up-solid'\n | 'thumb-up'\n | 'tick-bold'\n | 'tick'\n | 'time'\n | 'transfer-cancel'\n | 'transfer-locked'\n | 'transfer'\n | 'undo'\n | 'undock'\n | 'unreconciled'\n | 'warning'\n | 'webshop'\n | 'website'\n | 'workflow-template-basic'\n | 'workflow'\n | 'zoom';\n"],"names":["icons","AccountPreview","AccountingYearCancel","AccountingYear","accounting","Accounting","AiChatSolid","AiStars","ArrowBottom","ArrowDown","ArrowEnd","ArrowLeft","ArrowRight","ArrowStart","ArrowTop","ArrowUp","AttachAuto","AttachCancel","AttachWarning","attach","Attach","AutotextInsert","autotext","Autotext","BasicTabs","basic","Basic","BellSolid","book","Book","booking","Booking","budget","Budget","calendar","Calendar","CashAccount","CashReports","ChartArea","ChartBar","ChartLine","ChartPie","ChartTable","ChatSolid","chat","Chat","ChevronDownDouble","ChevronDownSolid","ChevronDown","ChevronLeftDouble","ChevronLeftSolid","ChevronLeft","ChevronRightDouble","ChevronRightSolid","ChevronRight","ChevronUpDouble","ChevronUpSolid","ChevronUp","CircleClose","CircleInformation","CircleMinus","CirclePlus","CircleQuestionmark","CircleTick","CircleWarning","ClampOpen","clamp","Clamp","close","Close","ColumnFreeze","ColumnUnfreeze","columns","Columns","ConnectionEnable","ConnectionRevoke","contacts","Contacts","copy","Copy","courses","Courses","credit","Credit","DeletePermanently","delete","Delete","depecriate","Depecriate","developer","Developer","DistributionTemplate","DocumentApprove","DocumentCreateEntry","DocumentCut","DocumentError","DocumentIsolatePage","DocumentMerge","DocumentMove","DocumentPreview","DocumentReceived","DocumentRejectedRequest","DocumentSplit","DocumentTime","document","Document","download","Download","drag","Drag","ECopedia","ESignature","EditSimple","edit","Edit","EllipsisHorizontal","EllipsisVertical","EntriesOnAccount","EntriesOpen","EntriesWarning","EntryTypeCustomerInvoice","EntryTypeCustomerPayment","EntryTypeJournalEntry","EntryTypeManualCustomerInvoice","EntryTypeSupplierInvoice","EntryTypeSupplierPayment","EnvelopeApproved","EnvelopeSolid","envelope","Envelope","ExpandView","expenses","Expenses","ExportToExcel","ExportToPdf","export","Export","EyeOff","EyeOn","FilterSolid","filter","Filter","FontSize","GraphSolid","hash","Hash","HeightExtraTall","HeightMedium","HeightShort","HeightTall","home","Home","images","Images","import","Import","InboxEinvoicing","InboxScanning","InboxSmart","inbox","Inbox","info","Info","InventoryMatrix","inventory","Inventory","JournalPro","LayoutBoth","LayoutFirst","LayoutLast","LayoutNone","layout","Layout","LedgerCardCustomerReminder","LedgerCardManualCustomerInvoice","LedgerCardObsoleteStock","LedgerCardOpeningEntry","LedgerCardReservedEntry","LedgerCardShrinkagePilferage","LedgerCardStockAdjustment","LedgerCardTransferredOpeningEntry","LedgerCard","lightbulb","Lightbulb","line","Line","LinkExternal","ListBulleted","ListSearch","list","List","location","Location","LockOpen","lock","Lock","LogOut","log","Log","market","Market","MatchAmount","MatchEntries","menu","Menu","mileage","Mileage","ModalResize","ModalShrink","MoreSolid","more","More","move","Move","NavigationList","NoteFollowUp","NoteRead","note","Note","numbers","Numbers","PartnerApi","PaymentPaid","PaymentUnpaid","period","Period","PersonChange","PersonMinus","PersonPlus","PersonTick","PhoneSolid","play","Play","PlusMinus","print","Print","ProcessPayment","ProductLedgerCard","profile","Profile","ProjectCards","projects","Projects","QuestionMarkBold","QuestionMark","quicklinks","Quicklinks","RatingBankruptcy","RatingPaymentProblems","reconciled","Reconciled","refresh","Refresh","ReportSolid","report","Report","restore","Restore","RotateLeft","RotateRight","sales","Sales","SearchBold","search","Search","SecureTick","secure","Secure","SettingsSolid","settings","Settings","shortcuts","Shortcuts","ShowAll","ShowLess","ShowMore","ShowTemplate","sliders","Sliders","smartpay","Smartpay","SortBy","StarSolid","star","Star","subscriptions","Subscriptions","SystemEntries","tag","Tag","TemplateOverride","templates","Templates","ThumbBoth","ThumbDownSolid","ThumbDown","ThumbUpSolid","ThumbUp","TickBold","tick","Tick","time","Time","TransferCancel","TransferLocked","transfer","Transfer","undo","Undo","undock","Undock","unreconciled","Unreconciled","warning","Warning","webshop","Webshop","website","Website","WorkflowTemplateBasic","workflow","Workflow","zoom","Zoom"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Ac;EAClC,YAAY,EAAEC,SAAS;EACvB,gBAAgB,EAAEC,YAAY;EAC9B,UAAU,EAAEC,OAAO;EACnB,WAAW,EAAEC,QAAQ;EACrBC,IAAI,EAAEC,IAAI;EACVC,IAAI,EAAEC,IAAI;EACV,iBAAiB,EAAEC,cAAc;EACjC,iBAAiB,EAAEC,cAAc;EACjCC,QAAQ,EAAEC,QAAQ;EAClBC,IAAI,EAAEC,IAAI;EACVC,MAAM,EAAEC,MAAM;EACdC,YAAY,EAAEC,YAAY;EAC1BC,OAAO,EAAEC,OAAO;EAChBC,OAAO,EAAEC,OAAO;EAChBC,OAAO,EAAEC,OAAO;EAChB,yBAAyB,EAAEC,qBAAqB;EAChDC,QAAQ,EAAEC,QAAQ;EAClBC,IAAI,EAAEC;;;;;"}
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../src/components/Icon/components/index.tsx"],"sourcesContent":["import AccountPreview from './AccountPreview';\nimport AccountingYearCancel from './AccountingYearCancel';\nimport AccountingYear from './AccountingYear';\nimport Accounting from './Accounting';\nimport AiChatSolid from './AiChatSolid';\nimport AiStars from './AiStars';\nimport ArrowBottom from './ArrowBottom';\nimport ArrowDown from './ArrowDown';\nimport ArrowEnd from './ArrowEnd';\nimport ArrowLeft from './ArrowLeft';\nimport ArrowRight from './ArrowRight';\nimport ArrowStart from './ArrowStart';\nimport ArrowTop from './ArrowTop';\nimport ArrowUp from './ArrowUp';\nimport AttachAuto from './AttachAuto';\nimport AttachCancel from './AttachCancel';\nimport AttachWarning from './AttachWarning';\nimport Attach from './Attach';\nimport AutotextInsert from './AutotextInsert';\nimport Autotext from './Autotext';\nimport BasicTabs from './BasicTabs';\nimport Basic from './Basic';\nimport BellSolid from './BellSolid';\nimport Book from './Book';\nimport Booking from './Booking';\nimport Budget from './Budget';\nimport Calendar from './Calendar';\nimport CashAccount from './CashAccount';\nimport CashReports from './CashReports';\nimport ChartArea from './ChartArea';\nimport ChartBar from './ChartBar';\nimport ChartLine from './ChartLine';\nimport ChartPie from './ChartPie';\nimport ChartTable from './ChartTable';\nimport ChatSolid from './ChatSolid';\nimport Chat from './Chat';\nimport ChevronDownDouble from './ChevronDownDouble';\nimport ChevronDownSolid from './ChevronDownSolid';\nimport ChevronDown from './ChevronDown';\nimport ChevronLeftDouble from './ChevronLeftDouble';\nimport ChevronLeftSolid from './ChevronLeftSolid';\nimport ChevronLeft from './ChevronLeft';\nimport ChevronRightDouble from './ChevronRightDouble';\nimport ChevronRightSolid from './ChevronRightSolid';\nimport ChevronRight from './ChevronRight';\nimport ChevronUpDouble from './ChevronUpDouble';\nimport ChevronUpSolid from './ChevronUpSolid';\nimport ChevronUp from './ChevronUp';\nimport CircleClose from './CircleClose';\nimport CircleInformation from './CircleInformation';\nimport CircleMinus from './CircleMinus';\nimport CirclePlus from './CirclePlus';\nimport CircleQuestionmark from './CircleQuestionmark';\nimport CircleTick from './CircleTick';\nimport CircleWarning from './CircleWarning';\nimport ClampOpen from './ClampOpen';\nimport Clamp from './Clamp';\nimport Close from './Close';\nimport ColumnFreeze from './ColumnFreeze';\nimport ColumnUnfreeze from './ColumnUnfreeze';\nimport Columns from './Columns';\nimport ConnectionEnable from './ConnectionEnable';\nimport ConnectionRevoke from './ConnectionRevoke';\nimport Contacts from './Contacts';\nimport Copy from './Copy';\nimport Courses from './Courses';\nimport Credit from './Credit';\nimport DeletePermanently from './DeletePermanently';\nimport Delete from './Delete';\nimport Depecriate from './Depecriate';\nimport Developer from './Developer';\nimport DistributionTemplate from './DistributionTemplate';\nimport DocumentApprove from './DocumentApprove';\nimport DocumentCreateEntry from './DocumentCreateEntry';\nimport DocumentCut from './DocumentCut';\nimport DocumentError from './DocumentError';\nimport DocumentIsolatePage from './DocumentIsolatePage';\nimport DocumentMerge from './DocumentMerge';\nimport DocumentMove from './DocumentMove';\nimport DocumentPreview from './DocumentPreview';\nimport DocumentReceived from './DocumentReceived';\nimport DocumentRejectedRequest from './DocumentRejectedRequest';\nimport DocumentSplit from './DocumentSplit';\nimport DocumentTime from './DocumentTime';\nimport Document from './Document';\nimport Download from './Download';\nimport Drag from './Drag';\nimport ECopedia from './ECopedia';\nimport ESignature from './ESignature';\nimport EditSimple from './EditSimple';\nimport Edit from './Edit';\nimport EllipsisHorizontal from './EllipsisHorizontal';\nimport EllipsisVertical from './EllipsisVertical';\nimport EntriesOnAccount from './EntriesOnAccount';\nimport EntriesOpen from './EntriesOpen';\nimport EntriesWarning from './EntriesWarning';\nimport EntryTypeCustomerInvoice from './EntryTypeCustomerInvoice';\nimport EntryTypeCustomerPayment from './EntryTypeCustomerPayment';\nimport EntryTypeJournalEntry from './EntryTypeJournalEntry';\nimport EntryTypeManualCustomerInvoice from './EntryTypeManualCustomerInvoice';\nimport EntryTypeSupplierInvoice from './EntryTypeSupplierInvoice';\nimport EntryTypeSupplierPayment from './EntryTypeSupplierPayment';\nimport EnvelopeApproved from './EnvelopeApproved';\nimport EnvelopeSolid from './EnvelopeSolid';\nimport Envelope from './Envelope';\nimport ExpandView from './ExpandView';\nimport Expenses from './Expenses';\nimport ExportToExcel from './ExportToExcel';\nimport ExportToPdf from './ExportToPdf';\nimport Export from './Export';\nimport EyeOff from './EyeOff';\nimport EyeOn from './EyeOn';\nimport FilterSolid from './FilterSolid';\nimport Filter from './Filter';\nimport FontSize from './FontSize';\nimport GraphSolid from './GraphSolid';\nimport Hash from './Hash';\nimport HeightExtraTall from './HeightExtraTall';\nimport HeightMedium from './HeightMedium';\nimport HeightShort from './HeightShort';\nimport HeightTall from './HeightTall';\nimport Home from './Home';\nimport Images from './Images';\nimport Import from './Import';\nimport InboxEinvoicing from './InboxEinvoicing';\nimport InboxScanning from './InboxScanning';\nimport InboxSmart from './InboxSmart';\nimport Inbox from './Inbox';\nimport Info from './Info';\nimport InventoryMatrix from './InventoryMatrix';\nimport Inventory from './Inventory';\nimport JournalPro from './JournalPro';\nimport LayoutBoth from './LayoutBoth';\nimport LayoutFirst from './LayoutFirst';\nimport LayoutLast from './LayoutLast';\nimport LayoutNone from './LayoutNone';\nimport Layout from './Layout';\nimport LedgerCardCustomerReminder from './LedgerCardCustomerReminder';\nimport LedgerCardManualCustomerInvoice from './LedgerCardManualCustomerInvoice';\nimport LedgerCardObsoleteStock from './LedgerCardObsoleteStock';\nimport LedgerCardOpeningEntry from './LedgerCardOpeningEntry';\nimport LedgerCardReservedEntry from './LedgerCardReservedEntry';\nimport LedgerCardShrinkagePilferage from './LedgerCardShrinkagePilferage';\nimport LedgerCardStockAdjustment from './LedgerCardStockAdjustment';\nimport LedgerCardTransferredOpeningEntry from './LedgerCardTransferredOpeningEntry';\nimport LedgerCard from './LedgerCard';\nimport Lightbulb from './Lightbulb';\nimport Line from './Line';\nimport LinkExternal from './LinkExternal';\nimport ListBulleted from './ListBulleted';\nimport ListSearch from './ListSearch';\nimport List from './List';\nimport Location from './Location';\nimport LockOpen from './LockOpen';\nimport Lock from './Lock';\nimport LogOut from './LogOut';\nimport Log from './Log';\nimport Market from './Market';\nimport MatchAmount from './MatchAmount';\nimport MatchEntries from './MatchEntries';\nimport Menu from './Menu';\nimport Mileage from './Mileage';\nimport ModalResize from './ModalResize';\nimport ModalShrink from './ModalShrink';\nimport MoreSolid from './MoreSolid';\nimport More from './More';\nimport Move from './Move';\nimport NavigationList from './NavigationList';\nimport NoteFollowUp from './NoteFollowUp';\nimport NoteRead from './NoteRead';\nimport Note from './Note';\nimport Numbers from './Numbers';\nimport PartnerApi from './PartnerApi';\nimport PaymentPaid from './PaymentPaid';\nimport PaymentUnpaid from './PaymentUnpaid';\nimport Period from './Period';\nimport PersonChange from './PersonChange';\nimport PersonMinus from './PersonMinus';\nimport PersonPlus from './PersonPlus';\nimport PersonTick from './PersonTick';\nimport PhoneSolid from './PhoneSolid';\nimport Phone from './Phone';\nimport Play from './Play';\nimport PlusMinus from './PlusMinus';\nimport Print from './Print';\nimport ProcessPayment from './ProcessPayment';\nimport ProductLedgerCard from './ProductLedgerCard';\nimport Profile from './Profile';\nimport ProjectCards from './ProjectCards';\nimport Projects from './Projects';\nimport QuestionMarkBold from './QuestionMarkBold';\nimport QuestionMark from './QuestionMark';\nimport Quicklinks from './Quicklinks';\nimport RatingBankruptcy from './RatingBankruptcy';\nimport RatingPaymentProblems from './RatingPaymentProblems';\nimport Reconciled from './Reconciled';\nimport Refresh from './Refresh';\nimport ReportSolid from './ReportSolid';\nimport Report from './Report';\nimport Restore from './Restore';\nimport RotateLeft from './RotateLeft';\nimport RotateRight from './RotateRight';\nimport Sales from './Sales';\nimport SearchBold from './SearchBold';\nimport Search from './Search';\nimport SecureTick from './SecureTick';\nimport Secure from './Secure';\nimport SettingsSolid from './SettingsSolid';\nimport Settings from './Settings';\nimport Shortcuts from './Shortcuts';\nimport ShowAll from './ShowAll';\nimport ShowLess from './ShowLess';\nimport ShowMore from './ShowMore';\nimport ShowTemplate from './ShowTemplate';\nimport Sliders from './Sliders';\nimport Smartpay from './Smartpay';\nimport SortBy from './SortBy';\nimport StarSolid from './StarSolid';\nimport Star from './Star';\nimport Subscriptions from './Subscriptions';\nimport SystemEntries from './SystemEntries';\nimport Tag from './Tag';\nimport TemplateOverride from './TemplateOverride';\nimport Templates from './Templates';\nimport ThumbBoth from './ThumbBoth';\nimport ThumbDownSolid from './ThumbDownSolid';\nimport ThumbDown from './ThumbDown';\nimport ThumbUpSolid from './ThumbUpSolid';\nimport ThumbUp from './ThumbUp';\nimport TickBold from './TickBold';\nimport Tick from './Tick';\nimport Time from './Time';\nimport TransferCancel from './TransferCancel';\nimport TransferLocked from './TransferLocked';\nimport Transfer from './Transfer';\nimport Undo from './Undo';\nimport Undock from './Undock';\nimport Unreconciled from './Unreconciled';\nimport Warning from './Warning';\nimport Webshop from './Webshop';\nimport Website from './Website';\nimport WorkflowTemplateBasic from './WorkflowTemplateBasic';\nimport Workflow from './Workflow';\nimport Zoom from './Zoom';\n\nexport const icons: Record<\n IconName,\n React.ForwardRefExoticComponent<React.SVGAttributes<SVGSVGElement> & React.RefAttributes<SVGSVGElement>>\n> = {\n 'account-preview': AccountPreview,\n 'accounting-year-cancel': AccountingYearCancel,\n 'accounting-year': AccountingYear,\n accounting: Accounting,\n 'ai-chat-solid': AiChatSolid,\n 'ai-stars': AiStars,\n 'arrow-bottom': ArrowBottom,\n 'arrow-down': ArrowDown,\n 'arrow-end': ArrowEnd,\n 'arrow-left': ArrowLeft,\n 'arrow-right': ArrowRight,\n 'arrow-start': ArrowStart,\n 'arrow-top': ArrowTop,\n 'arrow-up': ArrowUp,\n 'attach-auto': AttachAuto,\n 'attach-cancel': AttachCancel,\n 'attach-warning': AttachWarning,\n attach: Attach,\n 'autotext-insert': AutotextInsert,\n autotext: Autotext,\n 'basic-tabs': BasicTabs,\n basic: Basic,\n 'bell-solid': BellSolid,\n book: Book,\n booking: Booking,\n budget: Budget,\n calendar: Calendar,\n 'cash-account': CashAccount,\n 'cash-reports': CashReports,\n 'chart-area': ChartArea,\n 'chart-bar': ChartBar,\n 'chart-line': ChartLine,\n 'chart-pie': ChartPie,\n 'chart-table': ChartTable,\n 'chat-solid': ChatSolid,\n chat: Chat,\n 'chevron-down-double': ChevronDownDouble,\n 'chevron-down-solid': ChevronDownSolid,\n 'chevron-down': ChevronDown,\n 'chevron-left-double': ChevronLeftDouble,\n 'chevron-left-solid': ChevronLeftSolid,\n 'chevron-left': ChevronLeft,\n 'chevron-right-double': ChevronRightDouble,\n 'chevron-right-solid': ChevronRightSolid,\n 'chevron-right': ChevronRight,\n 'chevron-up-double': ChevronUpDouble,\n 'chevron-up-solid': ChevronUpSolid,\n 'chevron-up': ChevronUp,\n 'circle-close': CircleClose,\n 'circle-information': CircleInformation,\n 'circle-minus': CircleMinus,\n 'circle-plus': CirclePlus,\n 'circle-questionmark': CircleQuestionmark,\n 'circle-tick': CircleTick,\n 'circle-warning': CircleWarning,\n 'clamp-open': ClampOpen,\n clamp: Clamp,\n close: Close,\n 'column-freeze': ColumnFreeze,\n 'column-unfreeze': ColumnUnfreeze,\n columns: Columns,\n 'connection-enable': ConnectionEnable,\n 'connection-revoke': ConnectionRevoke,\n contacts: Contacts,\n copy: Copy,\n courses: Courses,\n credit: Credit,\n 'delete-permanently': DeletePermanently,\n delete: Delete,\n depecriate: Depecriate,\n developer: Developer,\n 'distribution-template': DistributionTemplate,\n 'document-approve': DocumentApprove,\n 'document-create-entry': DocumentCreateEntry,\n 'document-cut': DocumentCut,\n 'document-error': DocumentError,\n 'document-isolate-page': DocumentIsolatePage,\n 'document-merge': DocumentMerge,\n 'document-move': DocumentMove,\n 'document-preview': DocumentPreview,\n 'document-received': DocumentReceived,\n 'document-rejected-request': DocumentRejectedRequest,\n 'document-split': DocumentSplit,\n 'document-time': DocumentTime,\n document: Document,\n download: Download,\n drag: Drag,\n 'e-copedia': ECopedia,\n 'e-signature': ESignature,\n 'edit-simple': EditSimple,\n edit: Edit,\n 'ellipsis-horizontal': EllipsisHorizontal,\n 'ellipsis-vertical': EllipsisVertical,\n 'entries-on-account': EntriesOnAccount,\n 'entries-open': EntriesOpen,\n 'entries-warning': EntriesWarning,\n 'entry-type-customer-invoice': EntryTypeCustomerInvoice,\n 'entry-type-customer-payment': EntryTypeCustomerPayment,\n 'entry-type-journal-entry': EntryTypeJournalEntry,\n 'entry-type-manual-customer-invoice': EntryTypeManualCustomerInvoice,\n 'entry-type-supplier-invoice': EntryTypeSupplierInvoice,\n 'entry-type-supplier-payment': EntryTypeSupplierPayment,\n 'envelope-approved': EnvelopeApproved,\n 'envelope-solid': EnvelopeSolid,\n envelope: Envelope,\n 'expand-view': ExpandView,\n expenses: Expenses,\n 'export-to-excel': ExportToExcel,\n 'export-to-pdf': ExportToPdf,\n export: Export,\n 'eye-off': EyeOff,\n 'eye-on': EyeOn,\n 'filter-solid': FilterSolid,\n filter: Filter,\n 'font-size': FontSize,\n 'graph-solid': GraphSolid,\n hash: Hash,\n 'height-extra-tall': HeightExtraTall,\n 'height-medium': HeightMedium,\n 'height-short': HeightShort,\n 'height-tall': HeightTall,\n home: Home,\n images: Images,\n import: Import,\n 'inbox-einvoicing': InboxEinvoicing,\n 'inbox-scanning': InboxScanning,\n 'inbox-smart': InboxSmart,\n inbox: Inbox,\n info: Info,\n 'inventory-matrix': InventoryMatrix,\n inventory: Inventory,\n 'journal-pro': JournalPro,\n 'layout-both': LayoutBoth,\n 'layout-first': LayoutFirst,\n 'layout-last': LayoutLast,\n 'layout-none': LayoutNone,\n layout: Layout,\n 'ledger-card-customer-reminder': LedgerCardCustomerReminder,\n 'ledger-card-manual-customer-invoice': LedgerCardManualCustomerInvoice,\n 'ledger-card-obsolete-stock': LedgerCardObsoleteStock,\n 'ledger-card-opening-entry': LedgerCardOpeningEntry,\n 'ledger-card-reserved-entry': LedgerCardReservedEntry,\n 'ledger-card-shrinkage-pilferage': LedgerCardShrinkagePilferage,\n 'ledger-card-stock-adjustment': LedgerCardStockAdjustment,\n 'ledger-card-transferred-opening-entry': LedgerCardTransferredOpeningEntry,\n 'ledger-card': LedgerCard,\n lightbulb: Lightbulb,\n line: Line,\n 'link-external': LinkExternal,\n 'list-bulleted': ListBulleted,\n 'list-search': ListSearch,\n list: List,\n location: Location,\n 'lock-open': LockOpen,\n lock: Lock,\n 'log-out': LogOut,\n log: Log,\n market: Market,\n 'match-amount': MatchAmount,\n 'match-entries': MatchEntries,\n menu: Menu,\n mileage: Mileage,\n 'modal-resize': ModalResize,\n 'modal-shrink': ModalShrink,\n 'more-solid': MoreSolid,\n more: More,\n move: Move,\n 'navigation-list': NavigationList,\n 'note-follow-up': NoteFollowUp,\n 'note-read': NoteRead,\n note: Note,\n numbers: Numbers,\n 'partner-api': PartnerApi,\n 'payment-paid': PaymentPaid,\n 'payment-unpaid': PaymentUnpaid,\n period: Period,\n 'person-change': PersonChange,\n 'person-minus': PersonMinus,\n 'person-plus': PersonPlus,\n 'person-tick': PersonTick,\n 'phone-solid': PhoneSolid,\n phone: Phone,\n play: Play,\n 'plus-minus': PlusMinus,\n print: Print,\n 'process-payment': ProcessPayment,\n 'product-ledger-card': ProductLedgerCard,\n profile: Profile,\n 'project-cards': ProjectCards,\n projects: Projects,\n 'question-mark-bold': QuestionMarkBold,\n 'question-mark': QuestionMark,\n quicklinks: Quicklinks,\n 'rating-bankruptcy': RatingBankruptcy,\n 'rating-payment-problems': RatingPaymentProblems,\n reconciled: Reconciled,\n refresh: Refresh,\n 'report-solid': ReportSolid,\n report: Report,\n restore: Restore,\n 'rotate-left': RotateLeft,\n 'rotate-right': RotateRight,\n sales: Sales,\n 'search-bold': SearchBold,\n search: Search,\n 'secure-tick': SecureTick,\n secure: Secure,\n 'settings-solid': SettingsSolid,\n settings: Settings,\n shortcuts: Shortcuts,\n 'show-all': ShowAll,\n 'show-less': ShowLess,\n 'show-more': ShowMore,\n 'show-template': ShowTemplate,\n sliders: Sliders,\n smartpay: Smartpay,\n 'sort-by': SortBy,\n 'star-solid': StarSolid,\n star: Star,\n subscriptions: Subscriptions,\n 'system-entries': SystemEntries,\n tag: Tag,\n 'template-override': TemplateOverride,\n templates: Templates,\n 'thumb-both': ThumbBoth,\n 'thumb-down-solid': ThumbDownSolid,\n 'thumb-down': ThumbDown,\n 'thumb-up-solid': ThumbUpSolid,\n 'thumb-up': ThumbUp,\n 'tick-bold': TickBold,\n tick: Tick,\n time: Time,\n 'transfer-cancel': TransferCancel,\n 'transfer-locked': TransferLocked,\n transfer: Transfer,\n undo: Undo,\n undock: Undock,\n unreconciled: Unreconciled,\n warning: Warning,\n webshop: Webshop,\n website: Website,\n 'workflow-template-basic': WorkflowTemplateBasic,\n workflow: Workflow,\n zoom: Zoom,\n};\n\n// the prop extraction tool can't handle this\n//export type IconName = keyof typeof icons;\nexport type IconName =\n | 'account-preview'\n | 'accounting-year-cancel'\n | 'accounting-year'\n | 'accounting'\n | 'ai-chat-solid'\n | 'ai-stars'\n | 'arrow-bottom'\n | 'arrow-down'\n | 'arrow-end'\n | 'arrow-left'\n | 'arrow-right'\n | 'arrow-start'\n | 'arrow-top'\n | 'arrow-up'\n | 'attach-auto'\n | 'attach-cancel'\n | 'attach-warning'\n | 'attach'\n | 'autotext-insert'\n | 'autotext'\n | 'basic-tabs'\n | 'basic'\n | 'bell-solid'\n | 'book'\n | 'booking'\n | 'budget'\n | 'calendar'\n | 'cash-account'\n | 'cash-reports'\n | 'chart-area'\n | 'chart-bar'\n | 'chart-line'\n | 'chart-pie'\n | 'chart-table'\n | 'chat-solid'\n | 'chat'\n | 'chevron-down-double'\n | 'chevron-down-solid'\n | 'chevron-down'\n | 'chevron-left-double'\n | 'chevron-left-solid'\n | 'chevron-left'\n | 'chevron-right-double'\n | 'chevron-right-solid'\n | 'chevron-right'\n | 'chevron-up-double'\n | 'chevron-up-solid'\n | 'chevron-up'\n | 'circle-close'\n | 'circle-information'\n | 'circle-minus'\n | 'circle-plus'\n | 'circle-questionmark'\n | 'circle-tick'\n | 'circle-warning'\n | 'clamp-open'\n | 'clamp'\n | 'close'\n | 'column-freeze'\n | 'column-unfreeze'\n | 'columns'\n | 'connection-enable'\n | 'connection-revoke'\n | 'contacts'\n | 'copy'\n | 'courses'\n | 'credit'\n | 'delete-permanently'\n | 'delete'\n | 'depecriate'\n | 'developer'\n | 'distribution-template'\n | 'document-approve'\n | 'document-create-entry'\n | 'document-cut'\n | 'document-error'\n | 'document-isolate-page'\n | 'document-merge'\n | 'document-move'\n | 'document-preview'\n | 'document-received'\n | 'document-rejected-request'\n | 'document-split'\n | 'document-time'\n | 'document'\n | 'download'\n | 'drag'\n | 'e-copedia'\n | 'e-signature'\n | 'edit-simple'\n | 'edit'\n | 'ellipsis-horizontal'\n | 'ellipsis-vertical'\n | 'entries-on-account'\n | 'entries-open'\n | 'entries-warning'\n | 'entry-type-customer-invoice'\n | 'entry-type-customer-payment'\n | 'entry-type-journal-entry'\n | 'entry-type-manual-customer-invoice'\n | 'entry-type-supplier-invoice'\n | 'entry-type-supplier-payment'\n | 'envelope-approved'\n | 'envelope-solid'\n | 'envelope'\n | 'expand-view'\n | 'expenses'\n | 'export-to-excel'\n | 'export-to-pdf'\n | 'export'\n | 'eye-off'\n | 'eye-on'\n | 'filter-solid'\n | 'filter'\n | 'font-size'\n | 'graph-solid'\n | 'hash'\n | 'height-extra-tall'\n | 'height-medium'\n | 'height-short'\n | 'height-tall'\n | 'home'\n | 'images'\n | 'import'\n | 'inbox-einvoicing'\n | 'inbox-scanning'\n | 'inbox-smart'\n | 'inbox'\n | 'info'\n | 'inventory-matrix'\n | 'inventory'\n | 'journal-pro'\n | 'layout-both'\n | 'layout-first'\n | 'layout-last'\n | 'layout-none'\n | 'layout'\n | 'ledger-card-customer-reminder'\n | 'ledger-card-manual-customer-invoice'\n | 'ledger-card-obsolete-stock'\n | 'ledger-card-opening-entry'\n | 'ledger-card-reserved-entry'\n | 'ledger-card-shrinkage-pilferage'\n | 'ledger-card-stock-adjustment'\n | 'ledger-card-transferred-opening-entry'\n | 'ledger-card'\n | 'lightbulb'\n | 'line'\n | 'link-external'\n | 'list-bulleted'\n | 'list-search'\n | 'list'\n | 'location'\n | 'lock-open'\n | 'lock'\n | 'log-out'\n | 'log'\n | 'market'\n | 'match-amount'\n | 'match-entries'\n | 'menu'\n | 'mileage'\n | 'modal-resize'\n | 'modal-shrink'\n | 'more-solid'\n | 'more'\n | 'move'\n | 'navigation-list'\n | 'note-follow-up'\n | 'note-read'\n | 'note'\n | 'numbers'\n | 'partner-api'\n | 'payment-paid'\n | 'payment-unpaid'\n | 'period'\n | 'person-change'\n | 'person-minus'\n | 'person-plus'\n | 'person-tick'\n | 'phone-solid'\n | 'phone'\n | 'play'\n | 'plus-minus'\n | 'print'\n | 'process-payment'\n | 'product-ledger-card'\n | 'profile'\n | 'project-cards'\n | 'projects'\n | 'question-mark-bold'\n | 'question-mark'\n | 'quicklinks'\n | 'rating-bankruptcy'\n | 'rating-payment-problems'\n | 'reconciled'\n | 'refresh'\n | 'report-solid'\n | 'report'\n | 'restore'\n | 'rotate-left'\n | 'rotate-right'\n | 'sales'\n | 'search-bold'\n | 'search'\n | 'secure-tick'\n | 'secure'\n | 'settings-solid'\n | 'settings'\n | 'shortcuts'\n | 'show-all'\n | 'show-less'\n | 'show-more'\n | 'show-template'\n | 'sliders'\n | 'smartpay'\n | 'sort-by'\n | 'star-solid'\n | 'star'\n | 'subscriptions'\n | 'system-entries'\n | 'tag'\n | 'template-override'\n | 'templates'\n | 'thumb-both'\n | 'thumb-down-solid'\n | 'thumb-down'\n | 'thumb-up-solid'\n | 'thumb-up'\n | 'tick-bold'\n | 'tick'\n | 'time'\n | 'transfer-cancel'\n | 'transfer-locked'\n | 'transfer'\n | 'undo'\n | 'undock'\n | 'unreconciled'\n | 'warning'\n | 'webshop'\n | 'website'\n | 'workflow-template-basic'\n | 'workflow'\n | 'zoom';\n"],"names":["icons","AccountPreview","AccountingYearCancel","AccountingYear","accounting","Accounting","AiChatSolid","AiStars","ArrowBottom","ArrowDown","ArrowEnd","ArrowLeft","ArrowRight","ArrowStart","ArrowTop","ArrowUp","AttachAuto","AttachCancel","AttachWarning","attach","Attach","AutotextInsert","autotext","Autotext","BasicTabs","basic","Basic","BellSolid","book","Book","booking","Booking","budget","Budget","calendar","Calendar","CashAccount","CashReports","ChartArea","ChartBar","ChartLine","ChartPie","ChartTable","ChatSolid","chat","Chat","ChevronDownDouble","ChevronDownSolid","ChevronDown","ChevronLeftDouble","ChevronLeftSolid","ChevronLeft","ChevronRightDouble","ChevronRightSolid","ChevronRight","ChevronUpDouble","ChevronUpSolid","ChevronUp","CircleClose","CircleInformation","CircleMinus","CirclePlus","CircleQuestionmark","CircleTick","CircleWarning","ClampOpen","clamp","Clamp","close","Close","ColumnFreeze","ColumnUnfreeze","columns","Columns","ConnectionEnable","ConnectionRevoke","contacts","Contacts","copy","Copy","courses","Courses","credit","Credit","DeletePermanently","delete","Delete","depecriate","Depecriate","developer","Developer","DistributionTemplate","DocumentApprove","DocumentCreateEntry","DocumentCut","DocumentError","DocumentIsolatePage","DocumentMerge","DocumentMove","DocumentPreview","DocumentReceived","DocumentRejectedRequest","DocumentSplit","DocumentTime","document","Document","download","Download","drag","Drag","ECopedia","ESignature","EditSimple","edit","Edit","EllipsisHorizontal","EllipsisVertical","EntriesOnAccount","EntriesOpen","EntriesWarning","EntryTypeCustomerInvoice","EntryTypeCustomerPayment","EntryTypeJournalEntry","EntryTypeManualCustomerInvoice","EntryTypeSupplierInvoice","EntryTypeSupplierPayment","EnvelopeApproved","EnvelopeSolid","envelope","Envelope","ExpandView","expenses","Expenses","ExportToExcel","ExportToPdf","export","Export","EyeOff","EyeOn","FilterSolid","filter","Filter","FontSize","GraphSolid","hash","Hash","HeightExtraTall","HeightMedium","HeightShort","HeightTall","home","Home","images","Images","import","Import","InboxEinvoicing","InboxScanning","InboxSmart","inbox","Inbox","info","Info","InventoryMatrix","inventory","Inventory","JournalPro","LayoutBoth","LayoutFirst","LayoutLast","LayoutNone","layout","Layout","LedgerCardCustomerReminder","LedgerCardManualCustomerInvoice","LedgerCardObsoleteStock","LedgerCardOpeningEntry","LedgerCardReservedEntry","LedgerCardShrinkagePilferage","LedgerCardStockAdjustment","LedgerCardTransferredOpeningEntry","LedgerCard","lightbulb","Lightbulb","line","Line","LinkExternal","ListBulleted","ListSearch","list","List","location","Location","LockOpen","lock","Lock","LogOut","log","Log","market","Market","MatchAmount","MatchEntries","menu","Menu","mileage","Mileage","ModalResize","ModalShrink","MoreSolid","more","More","move","Move","NavigationList","NoteFollowUp","NoteRead","note","Note","numbers","Numbers","PartnerApi","PaymentPaid","PaymentUnpaid","period","Period","PersonChange","PersonMinus","PersonPlus","PersonTick","PhoneSolid","phone","Phone","play","Play","PlusMinus","print","Print","ProcessPayment","ProductLedgerCard","profile","Profile","ProjectCards","projects","Projects","QuestionMarkBold","QuestionMark","quicklinks","Quicklinks","RatingBankruptcy","RatingPaymentProblems","reconciled","Reconciled","refresh","Refresh","ReportSolid","report","Report","restore","Restore","RotateLeft","RotateRight","sales","Sales","SearchBold","search","Search","SecureTick","secure","Secure","SettingsSolid","settings","Settings","shortcuts","Shortcuts","ShowAll","ShowLess","ShowMore","ShowTemplate","sliders","Sliders","smartpay","Smartpay","SortBy","StarSolid","star","Star","subscriptions","Subscriptions","SystemEntries","tag","Tag","TemplateOverride","templates","Templates","ThumbBoth","ThumbDownSolid","ThumbDown","ThumbUpSolid","ThumbUp","TickBold","tick","Tick","time","Time","TransferCancel","TransferLocked","transfer","Transfer","undo","Undo","undock","Undock","unreconciled","Unreconciled","warning","Warning","webshop","Webshop","website","Website","WorkflowTemplateBasic","workflow","Workflow","zoom","Zoom"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqPaA,KAAK,GAGd;EACA,iBAAiB,EAAEC,cAAc;EACjC,wBAAwB,EAAEC,oBAAoB;EAC9C,iBAAiB,EAAEC,cAAc;EACjCC,UAAU,EAAEC,UAAU;EACtB,eAAe,EAAEC,WAAW;EAC5B,UAAU,EAAEC,OAAO;EACnB,cAAc,EAAEC,WAAW;EAC3B,YAAY,EAAEC,SAAS;EACvB,WAAW,EAAEC,QAAQ;EACrB,YAAY,EAAEC,SAAS;EACvB,aAAa,EAAEC,UAAU;EACzB,aAAa,EAAEC,UAAU;EACzB,WAAW,EAAEC,QAAQ;EACrB,UAAU,EAAEC,OAAO;EACnB,aAAa,EAAEC,UAAU;EACzB,eAAe,EAAEC,YAAY;EAC7B,gBAAgB,EAAEC,aAAa;EAC/BC,MAAM,EAAEC,MAAM;EACd,iBAAiB,EAAEC,cAAc;EACjCC,QAAQ,EAAEC,QAAQ;EAClB,YAAY,EAAEC,SAAS;EACvBC,KAAK,EAAEC,KAAK;EACZ,YAAY,EAAEC,SAAS;EACvBC,IAAI,EAAEC,IAAI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AAEC,UAAU;EACzBC,MAAM,EAAEC,MAAM;EACd,gBAAgB,EAAEC,aAAa;EAC/BC,QAAQ,EAAEC,QAAQ;EAClBC,SAAS,EAAEC,SAAS;EACpB,UAAU,EAAEC,OAAO;EACnB,WAAW,EAAEC,QAAQ;EACrB,WAAW,EAAEC,QAAQ;EACrB,eAAe,EAAEC,YAAY;EAC7BC,OAAO,EAAEC,OAAO;EAChBC,QAAQ,EAAEC,QAAQ;EAClB,SAAS,EAAEC,MAAM;EACjB,YAAY,EAAEC,SAAS;EACvBC,IAAI,EAAEC,IAAI;EACVC,aAAa,EAAEC,aAAa;EAC5B,gBAAgB,EAAEC,aAAa;EAC/BC,GAAG,EAAEC,GAAG;EACR,mBAAmB,EAAEC,gBAAgB;EACrCC,SAAS,EAAEC,SAAS;EACpB,YAAY,EAAEC,SAAS;EACvB,kBAAkB,EAAEC,cAAc;EAClC,YAAY,EAAEC,SAAS;EACvB,gBAAgB,EAAEC,YAAY;EAC9B,UAAU,EAAEC,OAAO;EACnB,WAAW,EAAEC,QAAQ;EACrBC,IAAI,EAAEC,IAAI;EACVC,IAAI,EAAEC,IAAI;EACV,iBAAiB,EAAEC,cAAc;EACjC,iBAAiB,EAAEC,cAAc;EACjCC,QAAQ,EAAEC,QAAQ;EAClBC,IAAI,EAAEC,IAAI;EACVC,MAAM,EAAEC,MAAM;EACdC,YAAY,EAAEC,YAAY;EAC1BC,OAAO,EAAEC,OAAO;EAChBC,OAAO,EAAEC,OAAO;EAChBC,OAAO,EAAEC,OAAO;EAChB,yBAAyB,EAAEC,qBAAqB;EAChDC,QAAQ,EAAEC,QAAQ;EAClBC,IAAI,EAAEC;;;;;"}
|
package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js
CHANGED
@@ -170,7 +170,7 @@ const MemoedEditingCell = /*#__PURE__*/React__default.memo(function MemoedEditin
|
|
170
170
|
if (type === 'datepicker') {
|
171
171
|
const handleChange = event => {
|
172
172
|
const newDate = event.detail;
|
173
|
-
if (isDate(value) && isDate(newDate) && !isWeakEqual(value, newDate)) {
|
173
|
+
if (!value || isDate(value) && isDate(newDate) && !isWeakEqual(value, newDate)) {
|
174
174
|
props.onChange(event.detail);
|
175
175
|
}
|
176
176
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EditingControlCell.js","sources":["../../../../../../../../../../src/components/Table3/components/Columns/Cell/EditingControlCell.tsx"],"sourcesContent":["import React from 'react';\nimport { TableMeta as ReactTableMeta, ColumnMeta as ReactTableColumnMeta } from '@tanstack/react-table';\nimport { isDate } from 'date-fns';\nimport { Datepicker } from '../../../../Datepicker/Datepicker';\nimport { Switch } from '../../../../Switch/Switch';\nimport { Input } from '../../../../Input/Input';\nimport { TableColumnDataType, TableColumnRendererControl, TableFontSize } from '../../../../../primitives/Table/types';\nimport { isWeakEqual as isWeakEqualDate } from '../../../../../utils/date';\nimport { RowMoveIndicator } from './Editing/RowMoveIndicator';\nimport { TextareaWithAutosizing } from './Editing/TextareaWithAutosizing';\nimport { Field } from '../../../../Field/Field';\nimport { isElementInsideOrTriggeredFromContainer } from '../../../../../utils/dom';\nimport { TableCellRendererProps } from '../../../../../primitives/Table/Core/types';\nimport { RowContext } from '../../../../../primitives/Table/Core/components/Row/RowContext';\nimport { getCellAttributes } from '../../../../../primitives/Table/Core/components/Columns/Cell/util';\nimport { useEditingCellAutofocus } from './util';\n\nexport function EditingControlCell<TType = unknown>(props: TableCellRendererProps<TType>) {\n const { cell, cellRef, isHighlighted, index } = props;\n const { rowIndex } = React.useContext(RowContext);\n const tableMeta = cell.getContext().table.options.meta as ReactTableMeta<TType>;\n const columnMeta = cell.column.columnDef.meta as ReactTableColumnMeta<TType, unknown>;\n const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;\n\n const handleFocus = useEditingCellAutofocus<TType>(props);\n\n const handleBlur = () => {\n tableMeta.editing.toggleDetailedMode(false);\n tableMeta.editing.validateCell(cell);\n };\n\n // ensure that blur runs when the cell gets unmounted (when vertically arrow key navigating)\n React.useEffect(() => {\n const ref = cellRef.current;\n\n return () => {\n if (document.activeElement === ref || isElementInsideOrTriggeredFromContainer(document.activeElement, ref)) {\n handleBlur();\n }\n };\n }, []);\n\n const error = tableMeta.editing.getCellError<TType>(cell);\n\n const controlProps = {\n dataType: columnMeta.dataType,\n fontSize: tableMeta.fontSize.size,\n id: cell.column.id,\n invalid: !!error,\n isDetailedMode: tableMeta.editing.isDetailedMode,\n isTruncated: !!columnMeta.enableTruncate,\n onBlur: handleBlur,\n onChange: (value: unknown) => tableMeta.editing.setCellValue(cell, value, rowIndex),\n row: cell.row.original,\n tabIndex: isActiveRow ? 0 : -1,\n toggleEditing: tableMeta.editing.toggleEditing,\n toggleDetailedMode: tableMeta.editing.toggleDetailedMode,\n type: columnMeta.control ?? 'input',\n value: cell.getValue(),\n };\n\n const cellAttributes = {\n ...getCellAttributes(cell, index, isHighlighted),\n 'data-cell-editing-invalid': error ? true : undefined,\n onFocus: handleFocus,\n ref: cellRef,\n tabIndex: -1,\n };\n\n return (\n <td {...cellAttributes}>\n <Field invalid={!!error} message={error}>\n <MemoedEditingCell<TType> {...controlProps} />\n </Field>\n {\n // we show row move indicator here within the cell rather than the row because it is\n // an editing only feature, and we don't want to leak editing into the shared row component\n }\n <RowMoveIndicator cell={cell} cellRef={cellRef} isActiveRow={isActiveRow} />\n </td>\n );\n}\n\ntype MemoedEditingCellProps<TType = unknown, TValue = unknown> = {\n dataType?: TableColumnDataType;\n fontSize: TableFontSize;\n id: string;\n invalid: boolean;\n isDetailedMode: boolean;\n isTruncated: boolean;\n onBlur: () => void;\n onChange: (value: TValue) => void;\n row: TType;\n tabIndex?: number;\n toggleEditing: (editing: React.SetStateAction<boolean>) => void;\n toggleDetailedMode: (detailed: React.SetStateAction<boolean>) => void;\n type: TableColumnRendererControl<TType>;\n value: TValue;\n};\n\nconst MemoedEditingCell = React.memo(function MemoedEditingCell<TType = unknown>(props: MemoedEditingCellProps<TType>) {\n const {\n dataType,\n fontSize,\n id,\n invalid,\n isDetailedMode,\n isTruncated,\n onBlur,\n onChange,\n row,\n tabIndex = -1,\n toggleEditing,\n toggleDetailedMode,\n type = 'input',\n value,\n } = props;\n const controlRef = React.useRef<HTMLElement>(null);\n const currentValue = row[id];\n const commonProps = {\n onBlur,\n ref: controlRef,\n tabIndex,\n };\n\n if (typeof type === 'function') {\n const controlFnProps = {\n ...commonProps,\n invalid,\n setValue: onChange,\n value,\n };\n return type(controlFnProps, row);\n }\n\n if (type === 'switch') {\n return (\n <Switch\n {...commonProps}\n checked={Boolean(value)}\n onChange={onChange}\n ref={controlRef as React.RefObject<HTMLButtonElement>}\n />\n );\n }\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n\n if (target.readOnly) {\n return;\n }\n\n // prevent active row navigation while in detailed mode\n if (\n isDetailedMode &&\n (event.key === 'ArrowUp' || event.key === 'ArrowDown' || event.key === 'ArrowLeft' || event.key === 'ArrowRight')\n ) {\n event.stopPropagation();\n }\n\n // enter or exit detail mode when pressing enter\n if (event.key === 'Enter') {\n // textareas support shift and enter, don't prevent default in that case\n if (event.shiftKey && isDetailedMode) {\n return;\n }\n\n event.preventDefault();\n\n if (isDetailedMode) {\n target.select?.();\n } else {\n target.setSelectionRange?.(target.value?.length, target.value?.length);\n }\n\n toggleDetailedMode(editing => !editing);\n return;\n }\n\n // reset the value, or exit edit mode when pressing escape\n if (event.key === 'Escape') {\n event.preventDefault();\n\n if (isDetailedMode) {\n toggleDetailedMode(false);\n\n if (value !== currentValue) {\n props.onChange(currentValue);\n }\n\n // have to let onChange run before selecting, otherwise the value changes\n requestAnimationFrame(() => target.select?.());\n } else {\n toggleEditing(false);\n }\n\n return;\n }\n\n // toggle into detailed mode when actually inputting something\n if (/^[a-z0-9]$/i.test(event.key) || event.key === 'Backspace') {\n toggleDetailedMode(true);\n }\n };\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (!isDetailedMode) {\n event.target.select();\n }\n };\n\n if (type === 'datepicker') {\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const newDate = (event as any).detail;\n\n if (isDate(value) && isDate(newDate) && !isWeakEqualDate(value as Date, newDate as Date)) {\n props.onChange((event as any).detail);\n }\n };\n\n return (\n <Datepicker\n {...commonProps}\n invalid={invalid}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleInputKeyDown}\n ref={controlRef as React.RefObject<HTMLInputElement>}\n value={value as Date}\n />\n );\n }\n\n if (type === 'textarea') {\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n onChange(event.target.value);\n };\n\n return (\n <TextareaWithAutosizing\n {...commonProps}\n fontSize={fontSize}\n invalid={invalid}\n isTruncated={isTruncated}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleInputKeyDown}\n ref={controlRef as React.RefObject<HTMLTextAreaElement>}\n value={String(value ?? '')}\n />\n );\n }\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange(dataType === 'number' && event.target.value ? Number.parseInt(event.target.value) : event.target.value);\n };\n\n return (\n <Input\n {...commonProps}\n invalid={invalid}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleInputKeyDown}\n ref={controlRef as React.RefObject<HTMLInputElement>}\n type={dataType === 'number' ? 'number' : undefined}\n value={dataType === 'number' ? (value as number) : String(value ?? '')}\n />\n );\n}) as <TType = unknown>(props: MemoedEditingCellProps<TType>) => JSX.Element;\n"],"names":["EditingControlCell","props","cell","cellRef","isHighlighted","index","rowIndex","React","useContext","RowContext","tableMeta","getContext","table","options","meta","columnMeta","column","columnDef","isActiveRow","rowActive","rowActiveIndex","handleFocus","useEditingCellAutofocus","handleBlur","editing","toggleDetailedMode","validateCell","useEffect","ref","current","document","activeElement","isElementInsideOrTriggeredFromContainer","error","getCellError","controlProps","dataType","fontSize","size","id","invalid","isDetailedMode","isTruncated","enableTruncate","onBlur","onChange","value","setCellValue","row","original","tabIndex","toggleEditing","type","_columnMeta$control","control","getValue","cellAttributes","getCellAttributes","undefined","onFocus","Field","message","MemoedEditingCell","RowMoveIndicator","memo","controlRef","useRef","currentValue","commonProps","controlFnProps","setValue","Switch","checked","Boolean","handleInputKeyDown","event","target","readOnly","key","stopPropagation","shiftKey","preventDefault","_target$select","select","call","_target$setSelectionR","_target$value","_target$value2","setSelectionRange","length","requestAnimationFrame","_target$select2","test","handleChange","newDate","detail","isDate","isWeakEqualDate","Datepicker","onKeyDown","TextareaWithAutosizing","String","Number","parseInt","Input"],"mappings":";;;;;;;;;;;;;;SAiBgBA,kBAAkBA,CAAkBC,KAAoC;;EACpF,MAAM;IAAEC,IAAI;IAAEC,OAAO;IAAEC,aAAa;IAAEC;GAAO,GAAGJ,KAAK;EACrD,MAAM;IAAEK;GAAU,GAAGC,cAAK,CAACC,UAAU,CAACC,UAAU,CAAC;EACjD,MAAMC,SAAS,GAAGR,IAAI,CAACS,UAAU,EAAE,CAACC,KAAK,CAACC,OAAO,CAACC,IAA6B;EAC/E,MAAMC,UAAU,GAAGb,IAAI,CAACc,MAAM,CAACC,SAAS,CAACH,IAA4C;EACrF,MAAMI,WAAW,GAAGR,SAAS,CAACS,SAAS,CAACC,cAAc,KAAKd,QAAQ;EAEnE,MAAMe,WAAW,GAAGC,uBAAuB,CAAQrB,KAAK,CAAC;EAEzD,MAAMsB,UAAU,GAAGA;IACfb,SAAS,CAACc,OAAO,CAACC,kBAAkB,CAAC,KAAK,CAAC;IAC3Cf,SAAS,CAACc,OAAO,CAACE,YAAY,CAACxB,IAAI,CAAC;GACvC;;EAGDK,cAAK,CAACoB,SAAS,CAAC;IACZ,MAAMC,GAAG,GAAGzB,OAAO,CAAC0B,OAAO;IAE3B,OAAO;MACH,IAAIC,QAAQ,CAACC,aAAa,KAAKH,GAAG,IAAII,uCAAuC,CAACF,QAAQ,CAACC,aAAa,EAAEH,GAA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;MAClBG,OAAO,EAAEA,OAAO;MAChBE,WAAW,EAAEA,WAAW;MACxBG,QAAQ,EAAEgD,YAAY;MACtBlC,OAAO,EAAEtC,WAAW;MACpB8E,SAAS,EAAEzB,kBAAkB;MAC7B9C,GAAG,EAAEqC,UAAkD;MACvDnB,KAAK,EAAEuD,MAAM,CAACvD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE;OAC3B;;EAIV,MAAM+C,YAAY,GAAIlB,KAA0C;IAC5D9B,QAAQ,CAACT,QAAQ,KAAK,QAAQ,IAAIuC,KAAK,CAACC,MAAM,CAAC9B,KAAK,GAAGwD,MAAM,CAACC,QAAQ,CAAC5B,KAAK,CAACC,MAAM,CAAC9B,KAAK,CAAC,GAAG6B,KAAK,CAACC,MAAM,CAAC9B,KAAK,CAAC;GACnH;EAED,oBACIvC,6BAACiG,KAAK,oBACEpC,WAAW;IACf5B,OAAO,EAAEA,OAAO;IAChBK,QAAQ,EAAEgD,YAAY;IACtBlC,OAAO,EAAEtC,WAAW;IACpB8E,SAAS,EAAEzB,kBAAkB;IAC7B9C,GAAG,EAAEqC,UAA+C;IACpDb,IAAI,EAAEhB,QAAQ,KAAK,QAAQ,GAAG,QAAQ,GAAGsB,SAAS;IAClDZ,KAAK,EAAEV,QAAQ,KAAK,QAAQ,GAAIU,KAAgB,GAAGuD,MAAM,CAACvD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE;KACvE;AAEV,CAAC,CAA2E;;;;"}
|
1
|
+
{"version":3,"file":"EditingControlCell.js","sources":["../../../../../../../../../../src/components/Table3/components/Columns/Cell/EditingControlCell.tsx"],"sourcesContent":["import React from 'react';\nimport { TableMeta as ReactTableMeta, ColumnMeta as ReactTableColumnMeta } from '@tanstack/react-table';\nimport { isDate } from 'date-fns';\nimport { Datepicker } from '../../../../Datepicker/Datepicker';\nimport { Switch } from '../../../../Switch/Switch';\nimport { Input } from '../../../../Input/Input';\nimport { TableColumnDataType, TableColumnRendererControl, TableFontSize } from '../../../../../primitives/Table/types';\nimport { isWeakEqual as isWeakEqualDate } from '../../../../../utils/date';\nimport { RowMoveIndicator } from './Editing/RowMoveIndicator';\nimport { TextareaWithAutosizing } from './Editing/TextareaWithAutosizing';\nimport { Field } from '../../../../Field/Field';\nimport { isElementInsideOrTriggeredFromContainer } from '../../../../../utils/dom';\nimport { TableCellRendererProps } from '../../../../../primitives/Table/Core/types';\nimport { RowContext } from '../../../../../primitives/Table/Core/components/Row/RowContext';\nimport { getCellAttributes } from '../../../../../primitives/Table/Core/components/Columns/Cell/util';\nimport { useEditingCellAutofocus } from './util';\n\nexport function EditingControlCell<TType = unknown>(props: TableCellRendererProps<TType>) {\n const { cell, cellRef, isHighlighted, index } = props;\n const { rowIndex } = React.useContext(RowContext);\n const tableMeta = cell.getContext().table.options.meta as ReactTableMeta<TType>;\n const columnMeta = cell.column.columnDef.meta as ReactTableColumnMeta<TType, unknown>;\n const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;\n\n const handleFocus = useEditingCellAutofocus<TType>(props);\n\n const handleBlur = () => {\n tableMeta.editing.toggleDetailedMode(false);\n tableMeta.editing.validateCell(cell);\n };\n\n // ensure that blur runs when the cell gets unmounted (when vertically arrow key navigating)\n React.useEffect(() => {\n const ref = cellRef.current;\n\n return () => {\n if (document.activeElement === ref || isElementInsideOrTriggeredFromContainer(document.activeElement, ref)) {\n handleBlur();\n }\n };\n }, []);\n\n const error = tableMeta.editing.getCellError<TType>(cell);\n\n const controlProps = {\n dataType: columnMeta.dataType,\n fontSize: tableMeta.fontSize.size,\n id: cell.column.id,\n invalid: !!error,\n isDetailedMode: tableMeta.editing.isDetailedMode,\n isTruncated: !!columnMeta.enableTruncate,\n onBlur: handleBlur,\n onChange: (value: unknown) => tableMeta.editing.setCellValue(cell, value, rowIndex),\n row: cell.row.original,\n tabIndex: isActiveRow ? 0 : -1,\n toggleEditing: tableMeta.editing.toggleEditing,\n toggleDetailedMode: tableMeta.editing.toggleDetailedMode,\n type: columnMeta.control ?? 'input',\n value: cell.getValue(),\n };\n\n const cellAttributes = {\n ...getCellAttributes(cell, index, isHighlighted),\n 'data-cell-editing-invalid': error ? true : undefined,\n onFocus: handleFocus,\n ref: cellRef,\n tabIndex: -1,\n };\n\n return (\n <td {...cellAttributes}>\n <Field invalid={!!error} message={error}>\n <MemoedEditingCell<TType> {...controlProps} />\n </Field>\n {\n // we show row move indicator here within the cell rather than the row because it is\n // an editing only feature, and we don't want to leak editing into the shared row component\n }\n <RowMoveIndicator cell={cell} cellRef={cellRef} isActiveRow={isActiveRow} />\n </td>\n );\n}\n\ntype MemoedEditingCellProps<TType = unknown, TValue = unknown> = {\n dataType?: TableColumnDataType;\n fontSize: TableFontSize;\n id: string;\n invalid: boolean;\n isDetailedMode: boolean;\n isTruncated: boolean;\n onBlur: () => void;\n onChange: (value: TValue) => void;\n row: TType;\n tabIndex?: number;\n toggleEditing: (editing: React.SetStateAction<boolean>) => void;\n toggleDetailedMode: (detailed: React.SetStateAction<boolean>) => void;\n type: TableColumnRendererControl<TType>;\n value: TValue;\n};\n\nconst MemoedEditingCell = React.memo(function MemoedEditingCell<TType = unknown>(props: MemoedEditingCellProps<TType>) {\n const {\n dataType,\n fontSize,\n id,\n invalid,\n isDetailedMode,\n isTruncated,\n onBlur,\n onChange,\n row,\n tabIndex = -1,\n toggleEditing,\n toggleDetailedMode,\n type = 'input',\n value,\n } = props;\n const controlRef = React.useRef<HTMLElement>(null);\n const currentValue = row[id];\n const commonProps = {\n onBlur,\n ref: controlRef,\n tabIndex,\n };\n\n if (typeof type === 'function') {\n const controlFnProps = {\n ...commonProps,\n invalid,\n setValue: onChange,\n value,\n };\n return type(controlFnProps, row);\n }\n\n if (type === 'switch') {\n return (\n <Switch\n {...commonProps}\n checked={Boolean(value)}\n onChange={onChange}\n ref={controlRef as React.RefObject<HTMLButtonElement>}\n />\n );\n }\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n\n if (target.readOnly) {\n return;\n }\n\n // prevent active row navigation while in detailed mode\n if (\n isDetailedMode &&\n (event.key === 'ArrowUp' || event.key === 'ArrowDown' || event.key === 'ArrowLeft' || event.key === 'ArrowRight')\n ) {\n event.stopPropagation();\n }\n\n // enter or exit detail mode when pressing enter\n if (event.key === 'Enter') {\n // textareas support shift and enter, don't prevent default in that case\n if (event.shiftKey && isDetailedMode) {\n return;\n }\n\n event.preventDefault();\n\n if (isDetailedMode) {\n target.select?.();\n } else {\n target.setSelectionRange?.(target.value?.length, target.value?.length);\n }\n\n toggleDetailedMode(editing => !editing);\n return;\n }\n\n // reset the value, or exit edit mode when pressing escape\n if (event.key === 'Escape') {\n event.preventDefault();\n\n if (isDetailedMode) {\n toggleDetailedMode(false);\n\n if (value !== currentValue) {\n props.onChange(currentValue);\n }\n\n // have to let onChange run before selecting, otherwise the value changes\n requestAnimationFrame(() => target.select?.());\n } else {\n toggleEditing(false);\n }\n\n return;\n }\n\n // toggle into detailed mode when actually inputting something\n if (/^[a-z0-9]$/i.test(event.key) || event.key === 'Backspace') {\n toggleDetailedMode(true);\n }\n };\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (!isDetailedMode) {\n event.target.select();\n }\n };\n\n if (type === 'datepicker') {\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const newDate = (event as any).detail;\n\n if (!value || (isDate(value) && isDate(newDate) && !isWeakEqualDate(value as Date, newDate as Date))) {\n props.onChange((event as any).detail);\n }\n };\n\n return (\n <Datepicker\n {...commonProps}\n invalid={invalid}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleInputKeyDown}\n ref={controlRef as React.RefObject<HTMLInputElement>}\n value={value as Date}\n />\n );\n }\n\n if (type === 'textarea') {\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n onChange(event.target.value);\n };\n\n return (\n <TextareaWithAutosizing\n {...commonProps}\n fontSize={fontSize}\n invalid={invalid}\n isTruncated={isTruncated}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleInputKeyDown}\n ref={controlRef as React.RefObject<HTMLTextAreaElement>}\n value={String(value ?? '')}\n />\n );\n }\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange(dataType === 'number' && event.target.value ? Number.parseInt(event.target.value) : event.target.value);\n };\n\n return (\n <Input\n {...commonProps}\n invalid={invalid}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleInputKeyDown}\n ref={controlRef as React.RefObject<HTMLInputElement>}\n type={dataType === 'number' ? 'number' : undefined}\n value={dataType === 'number' ? (value as number) : String(value ?? '')}\n />\n );\n}) as <TType = unknown>(props: MemoedEditingCellProps<TType>) => JSX.Element;\n"],"names":["EditingControlCell","props","cell","cellRef","isHighlighted","index","rowIndex","React","useContext","RowContext","tableMeta","getContext","table","options","meta","columnMeta","column","columnDef","isActiveRow","rowActive","rowActiveIndex","handleFocus","useEditingCellAutofocus","handleBlur","editing","toggleDetailedMode","validateCell","useEffect","ref","current","document","activeElement","isElementInsideOrTriggeredFromContainer","error","getCellError","controlProps","dataType","fontSize","size","id","invalid","isDetailedMode","isTruncated","enableTruncate","onBlur","onChange","value","setCellValue","row","original","tabIndex","toggleEditing","type","_columnMeta$control","control","getValue","cellAttributes","getCellAttributes","undefined","onFocus","Field","message","MemoedEditingCell","RowMoveIndicator","memo","controlRef","useRef","currentValue","commonProps","controlFnProps","setValue","Switch","checked","Boolean","handleInputKeyDown","event","target","readOnly","key","stopPropagation","shiftKey","preventDefault","_target$select","select","call","_target$setSelectionR","_target$value","_target$value2","setSelectionRange","length","requestAnimationFrame","_target$select2","test","handleChange","newDate","detail","isDate","isWeakEqualDate","Datepicker","onKeyDown","TextareaWithAutosizing","String","Number","parseInt","Input"],"mappings":";;;;;;;;;;;;;;SAiBgBA,kBAAkBA,CAAkBC,KAAoC;;EACpF,MAAM;IAAEC,IAAI;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B,KAAK,CAACC,MAAM,CAAC9B,KAAK,CAAC;GACnH;EAED,oBACIvC,6BAACiG,KAAK,oBACEpC,WAAW;IACf5B,OAAO,EAAEA,OAAO;IAChBK,QAAQ,EAAEgD,YAAY;IACtBlC,OAAO,EAAEtC,WAAW;IACpB8E,SAAS,EAAEzB,kBAAkB;IAC7B9C,GAAG,EAAEqC,UAA+C;IACpDb,IAAI,EAAEhB,QAAQ,KAAK,QAAQ,GAAG,QAAQ,GAAGsB,SAAS;IAClDZ,KAAK,EAAEV,QAAQ,KAAK,QAAQ,GAAIU,KAAgB,GAAGuD,MAAM,CAACvD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE;KACvE;AAEV,CAAC,CAA2E;;;;"}
|
@@ -29,8 +29,15 @@ function useEditingCellAutofocus(props) {
|
|
29
29
|
const tableElement = (_props$cellRef$curren3 = props.cellRef.current) === null || _props$cellRef$curren3 === void 0 ? void 0 : _props$cellRef$curren3.closest('table');
|
30
30
|
if (tableElement && table.getIsSomeColumnsPinned() && !props.cell.column.getIsPinned()) {
|
31
31
|
const columnFreezingOffset = table.getLeftTotalSize();
|
32
|
-
const
|
33
|
-
|
32
|
+
const targetRect = event.currentTarget.getBoundingClientRect();
|
33
|
+
const tableRect = tableElement.getBoundingClientRect();
|
34
|
+
const leftOffsetFromScrollContainer = targetRect.left - tableRect.left;
|
35
|
+
const scrollbarWidth = tableElement.offsetWidth - tableElement.clientWidth; // the width of table vertical scrollbar
|
36
|
+
if (
|
37
|
+
// When pinned column overlaps the focused cell
|
38
|
+
leftOffsetFromScrollContainer < columnFreezingOffset ||
|
39
|
+
// When focused cell goes behidn the edge of the table
|
40
|
+
leftOffsetFromScrollContainer + targetRect.width > tableRect.width - scrollbarWidth) {
|
34
41
|
tableElement.scrollTo(props.cell.column.getStart() - columnFreezingOffset, tableElement.scrollTop);
|
35
42
|
}
|
36
43
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../../../../../../../../src/components/Table3/components/Columns/Cell/util.ts"],"sourcesContent":["import React from 'react';\nimport { TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useAugmentedFocusManager } from '../../../../../primitives/Table/Core/components/Body/util';\nimport { TableCellRendererProps } from '../../../../../primitives/Table/Core/types';\nimport { RowContext } from '../../../../../primitives/Table/Core/components/Row/RowContext';\n\nexport function useEditingCellAutofocus<TType = unknown>(props: TableCellRendererProps<TType>) {\n const focusManager = useAugmentedFocusManager();\n const { rowIndex } = React.useContext(RowContext);\n const table = props.cell.getContext().table;\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;\n\n const autoFocus = props.index === tableMeta.editing.lastFocusedCellIndex && isActiveRow;\n\n // focus the cell so that we trigger it's handle focus\n React.useEffect(() => {\n if (props.cellRef.current) {\n const isFocusedElementInCurrentRow = props.cellRef.current.closest('tr')?.contains(document.activeElement);\n const isFocusedElementSearch = document.activeElement?.getAttribute('name') === 'table-search';\n\n if (autoFocus && !isFocusedElementInCurrentRow && !isFocusedElementSearch) {\n props.cellRef.current?.focus();\n }\n }\n }, [autoFocus]);\n\n // when the cell receives focus we actually want to focus the control inside it...\n const handleFocus = (event: React.FocusEvent<HTMLTableCellElement>) => {\n const tableElement = props.cellRef.current?.closest('table');\n\n if (tableElement && table.getIsSomeColumnsPinned() && !props.cell.column.getIsPinned()) {\n const columnFreezingOffset = table.getLeftTotalSize();\n const
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../../../../../../../../src/components/Table3/components/Columns/Cell/util.ts"],"sourcesContent":["import React from 'react';\nimport { TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useAugmentedFocusManager } from '../../../../../primitives/Table/Core/components/Body/util';\nimport { TableCellRendererProps } from '../../../../../primitives/Table/Core/types';\nimport { RowContext } from '../../../../../primitives/Table/Core/components/Row/RowContext';\n\nexport function useEditingCellAutofocus<TType = unknown>(props: TableCellRendererProps<TType>) {\n const focusManager = useAugmentedFocusManager();\n const { rowIndex } = React.useContext(RowContext);\n const table = props.cell.getContext().table;\n const tableMeta = table.options.meta as ReactTableMeta<TType>;\n const isActiveRow = tableMeta.rowActive.rowActiveIndex === rowIndex;\n\n const autoFocus = props.index === tableMeta.editing.lastFocusedCellIndex && isActiveRow;\n\n // focus the cell so that we trigger it's handle focus\n React.useEffect(() => {\n if (props.cellRef.current) {\n const isFocusedElementInCurrentRow = props.cellRef.current.closest('tr')?.contains(document.activeElement);\n const isFocusedElementSearch = document.activeElement?.getAttribute('name') === 'table-search';\n\n if (autoFocus && !isFocusedElementInCurrentRow && !isFocusedElementSearch) {\n props.cellRef.current?.focus();\n }\n }\n }, [autoFocus]);\n\n // when the cell receives focus we actually want to focus the control inside it...\n const handleFocus = (event: React.FocusEvent<HTMLTableCellElement>) => {\n const tableElement = props.cellRef.current?.closest('table');\n\n if (tableElement && table.getIsSomeColumnsPinned() && !props.cell.column.getIsPinned()) {\n const columnFreezingOffset = table.getLeftTotalSize();\n const targetRect = event.currentTarget.getBoundingClientRect();\n const tableRect = tableElement.getBoundingClientRect();\n const leftOffsetFromScrollContainer = targetRect.left - tableRect.left;\n const scrollbarWidth = tableElement.offsetWidth - tableElement.clientWidth; // the width of table vertical scrollbar\n\n if (\n // When pinned column overlaps the focused cell\n leftOffsetFromScrollContainer < columnFreezingOffset ||\n // When focused cell goes behidn the edge of the table\n leftOffsetFromScrollContainer + targetRect.width > tableRect.width - scrollbarWidth\n ) {\n tableElement.scrollTo(props.cell.column.getStart() - columnFreezingOffset, tableElement.scrollTop);\n }\n }\n\n if (event.target === event.currentTarget) {\n focusManager.focusNext();\n }\n };\n\n return handleFocus;\n}\n"],"names":["useEditingCellAutofocus","props","focusManager","useAugmentedFocusManager","rowIndex","React","useContext","RowContext","table","cell","getContext","tableMeta","options","meta","isActiveRow","rowActive","rowActiveIndex","autoFocus","index","editing","lastFocusedCellIndex","useEffect","cellRef","current","_props$cellRef$curren","_document$activeEleme","isFocusedElementInCurrentRow","closest","contains","document","activeElement","isFocusedElementSearch","getAttribute","_props$cellRef$curren2","focus","handleFocus","event","tableElement","_props$cellRef$curren3","getIsSomeColumnsPinned","column","getIsPinned","columnFreezingOffset","getLeftTotalSize","targetRect","currentTarget","getBoundingClientRect","tableRect","leftOffsetFromScrollContainer","left","scrollbarWidth","offsetWidth","clientWidth","width","scrollTo","getStart","scrollTop","target","focusNext"],"mappings":";;;;SAMgBA,uBAAuBA,CAAkBC,KAAoC;EACzF,MAAMC,YAAY,GAAGC,wBAAwB,EAAE;EAC/C,MAAM;IAAEC;GAAU,GAAGC,cAAK,CAACC,UAAU,CAACC,UAAU,CAAC;EACjD,MAAMC,KAAK,GAAGP,KAAK,CAACQ,IAAI,CAACC,UAAU,EAAE,CAACF,KAAK;EAC3C,MAAMG,SAAS,GAAGH,KAAK,CAACI,OAAO,CAACC,IAA6B;EAC7D,MAAMC,WAAW,GAAGH,SAAS,CAACI,SAAS,CAACC,cAAc,KAAKZ,QAAQ;EAEnE,MAAMa,SAAS,GAAGhB,KAAK,CAACiB,KAAK,KAAKP,SAAS,CAACQ,OAAO,CAACC,oBAAoB,IAAIN,WAAW;;EAGvFT,cAAK,CAACgB,SAAS,CAAC;IACZ,IAAIpB,KAAK,CAACqB,OAAO,CAACC,OAAO,EAAE;MAAA,IAAAC,qBAAA,EAAAC,qBAAA;MACvB,MAAMC,4BAA4B,IAAAF,qBAAA,GAAGvB,KAAK,CAACqB,OAAO,CAACC,OAAO,CAACI,OAAO,CAAC,IAAI,CAAC,cAAAH,qBAAA,uBAAnCA,qBAAA,CAAqCI,QAAQ,CAACC,QAAQ,CAACC,aAAa,CAAC;MAC1G,MAAMC,sBAAsB,GAAG,EAAAN,qBAAA,GAAAI,QAAQ,CAACC,aAAa,cAAAL,qBAAA,uBAAtBA,qBAAA,CAAwBO,YAAY,CAAC,MAAM,CAAC,MAAK,cAAc;MAE9F,IAAIf,SAAS,IAAI,CAACS,4BAA4B,IAAI,CAACK,sBA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+1,7 @@
|
|
1
1
|
import React__default from 'react';
|
2
2
|
import { isElementInsideOrTriggeredFromContainer } from '../../../utils/dom.js';
|
3
3
|
import { useGlobalKeyDown } from '../../../hooks/useGlobalKeyDown.js';
|
4
|
+
import { isDate } from 'date-fns';
|
4
5
|
import { _catch } from '../../../../../../node_modules/babel-plugin-transform-async-to-promises/helpers.mjs.js';
|
5
6
|
import { willRowMove } from '../util/editing.js';
|
6
7
|
|
@@ -17,7 +18,9 @@ function useTableEditing(isEnabled = false, handleSave, validator) {
|
|
17
18
|
const pendingChangesFns = usePendingChanges(isEnabled, handleSave, validator);
|
18
19
|
// if focus leaves the table in any way, trigger a save
|
19
20
|
const handleBlur = React__default.useCallback(event => {
|
20
|
-
|
21
|
+
// custom event from datepicker, and it doesn't have the relatedTarget property set.
|
22
|
+
const isClosingDatepicker = isDate(event.detail);
|
23
|
+
if (event.relatedTarget !== event.currentTarget && !isElementInsideOrTriggeredFromContainer(event.relatedTarget, event.currentTarget) && !isClosingDatepicker) {
|
21
24
|
pendingChangesFns.saveChanges();
|
22
25
|
}
|
23
26
|
}, [pendingChangesFns.saveChanges]);
|