@chayns-components/core 5.0.0-beta.244 → 5.0.0-beta.249

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,6 +47,10 @@ export type InputProps = {
47
47
  * Value if the input field should be controlled
48
48
  */
49
49
  value?: string;
50
+ /**
51
+ * If true, the input field is focused when the component is mounted
52
+ */
53
+ shouldUseAutoFocus?: boolean;
50
54
  };
51
55
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>>;
52
56
  export default Input;
@@ -22,7 +22,8 @@ const Input = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
22
22
  placeholderElement,
23
23
  shouldShowClearIcon = false,
24
24
  type = 'text',
25
- value
25
+ value,
26
+ shouldUseAutoFocus = false
26
27
  } = _ref;
27
28
  const [hasValue, setHasValue] = (0, _react.useState)(typeof value === 'string' && value !== '');
28
29
  const inputRef = (0, _react.useRef)(null);
@@ -76,7 +77,8 @@ const Input = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
76
77
  onKeyDown: onKeyDown,
77
78
  ref: inputRef,
78
79
  type: type,
79
- value: value
80
+ value: value,
81
+ autoFocus: shouldUseAutoFocus
80
82
  }), /*#__PURE__*/_react.default.createElement(_Input.StyledMotionInputLabel, {
81
83
  animate: {
82
84
  scale: hasValue ? 0.6 : 1
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","names":["_react","_interopRequireWildcard","require","_Icon","_interopRequireDefault","_Input","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Input","forwardRef","_ref","ref","iconElement","isDisabled","onBlur","onChange","onFocus","onKeyDown","placeholder","placeholderElement","shouldShowClearIcon","type","value","hasValue","setHasValue","useState","inputRef","useRef","handleClearIconClick","useCallback","current","target","handleInputFieldChange","event","useImperativeHandle","focus","_inputRef$current","useEffect","labelPosition","useMemo","bottom","right","left","top","createElement","StyledInput","className","StyledInputIconWrapper","StyledInputContent","StyledInputField","disabled","StyledMotionInputLabel","animate","scale","initial","layout","style","originX","originY","transition","StyledMotionInputClearIcon","opacity","onClick","icons","displayName","_default","exports"],"sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import React, {\n ChangeEvent,\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n HTMLInputTypeAttribute,\n KeyboardEventHandler,\n ReactNode,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport Icon from '../icon/Icon';\nimport {\n StyledInput,\n StyledInputContent,\n StyledInputField,\n StyledInputIconWrapper,\n StyledMotionInputClearIcon,\n StyledMotionInputLabel,\n} from './Input.styles';\n\nexport type InputRef = {\n focus: VoidFunction;\n};\n\nexport type InputProps = {\n /**\n * Icon element to be displayed on the left side of the input field\n */\n iconElement?: ReactNode;\n /**\n * Disables the input so that it cannot be changed anymore\n */\n isDisabled?: boolean;\n /**\n * Function that is executed when the input field loses focus\n */\n onBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when the text of the input changes\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when the input field is focused\n */\n onFocus?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when a letter is pressed\n */\n onKeyDown?: KeyboardEventHandler<HTMLInputElement>;\n /**\n * Placeholder for the input field\n */\n placeholder?: string;\n /**\n * Element to be displayed next to or instead of the \"placeholder\"\n */\n placeholderElement?: ReactNode;\n /**\n * If true, a clear icon is displayed at the end of the input field\n */\n shouldShowClearIcon?: boolean;\n /**\n * Input type set for input element (e.g. 'text', 'number' or 'password')\n */\n type?: HTMLInputTypeAttribute;\n /**\n * Value if the input field should be controlled\n */\n value?: string;\n};\n\nconst Input = forwardRef<InputRef, InputProps>(\n (\n {\n iconElement,\n isDisabled,\n onBlur,\n onChange,\n onFocus,\n onKeyDown,\n placeholder,\n placeholderElement,\n shouldShowClearIcon = false,\n type = 'text',\n value,\n },\n ref\n ) => {\n const [hasValue, setHasValue] = useState(typeof value === 'string' && value !== '');\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleClearIconClick = useCallback(() => {\n if (inputRef.current) {\n inputRef.current.value = '';\n\n if (typeof onChange === 'function') {\n onChange({ target: inputRef.current } as ChangeEvent<HTMLInputElement>);\n }\n }\n }, [onChange]);\n\n const handleInputFieldChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n setHasValue(event.target.value !== '');\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n },\n [onChange]\n );\n\n useImperativeHandle(\n ref,\n () => ({\n focus: () => inputRef.current?.focus(),\n }),\n []\n );\n\n useEffect(() => {\n if (typeof value === 'string') {\n setHasValue(value !== '');\n }\n }, [value]);\n\n const labelPosition = useMemo(() => {\n if (hasValue) {\n return { bottom: -8, right: -6 };\n }\n\n return { left: 0, top: 0 };\n }, [hasValue]);\n\n return (\n <StyledInput className=\"beta-chayns-input\" isDisabled={isDisabled}>\n {iconElement && <StyledInputIconWrapper>{iconElement}</StyledInputIconWrapper>}\n <StyledInputContent>\n <StyledInputField\n disabled={isDisabled}\n onBlur={onBlur}\n onChange={handleInputFieldChange}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n ref={inputRef}\n type={type}\n value={value}\n />\n <StyledMotionInputLabel\n animate={{ scale: hasValue ? 0.6 : 1 }}\n initial={false}\n layout\n style={{ ...labelPosition, originX: 1, originY: 1 }}\n transition={{ type: 'tween' }}\n >\n {placeholderElement}\n {placeholder}\n </StyledMotionInputLabel>\n </StyledInputContent>\n {shouldShowClearIcon && (\n <StyledMotionInputClearIcon\n animate={{ opacity: hasValue ? 1 : 0 }}\n initial={false}\n onClick={handleClearIconClick}\n transition={{ type: 'tween' }}\n >\n <Icon icons={['fa fa-times']} />\n </StyledMotionInputClearIcon>\n )}\n </StyledInput>\n );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AI,EAAEA,IAAK;IACXC,KAAK,EAAEA;EAAM,CAChB,CAAC,eACF1C,MAAA,CAAAQ,OAAA,CAAAwD,aAAA,CAAC3D,MAAA,CAAAkE,sBAAsB;IACnBC,OAAO,EAAE;MAAEC,KAAK,EAAE9B,QAAQ,GAAG,GAAG,GAAG;IAAE,CAAE;IACvC+B,OAAO,EAAE,KAAM;IACfC,MAAM;IACNC,KAAK,EAAE;MAAE,GAAGlB,aAAa;MAAEmB,OAAO,EAAE,CAAC;MAAEC,OAAO,EAAE;IAAE,CAAE;IACpDC,UAAU,EAAE;MAAEtC,IAAI,EAAE;IAAQ;EAAE,GAE7BF,kBAAkB,EAClBD,WACmB,CACR,CAAC,EACpBE,mBAAmB,iBAChBxC,MAAA,CAAAQ,OAAA,CAAAwD,aAAA,CAAC3D,MAAA,CAAA2E,0BAA0B;IACvBR,OAAO,EAAE;MAAES,OAAO,EAAEtC,QAAQ,GAAG,CAAC,GAAG;IAAE,CAAE;IACvC+B,OAAO,EAAE,KAAM;IACfQ,OAAO,EAAElC,oBAAqB;IAC9B+B,UAAU,EAAE;MAAEtC,IAAI,EAAE;IAAQ;EAAE,gBAE9BzC,MAAA,CAAAQ,OAAA,CAAAwD,aAAA,CAAC7D,KAAA,CAAAK,OAAI;IAAC2E,KAAK,EAAE,CAAC,aAAa;EAAE,CAAE,CACP,CAEvB,CAAC;AAEtB,CACJ,CAAC;AAEDvD,KAAK,CAACwD,WAAW,GAAG,OAAO;AAAC,IAAAC,QAAA,GAEbzD,KAAK;AAAA0D,OAAA,CAAA9E,OAAA,GAAA6E,QAAA"}
1
+ {"version":3,"file":"Input.js","names":["_react","_interopRequireWildcard","require","_Icon","_interopRequireDefault","_Input","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Input","forwardRef","_ref","ref","iconElement","isDisabled","onBlur","onChange","onFocus","onKeyDown","placeholder","placeholderElement","shouldShowClearIcon","type","value","shouldUseAutoFocus","hasValue","setHasValue","useState","inputRef","useRef","handleClearIconClick","useCallback","current","target","handleInputFieldChange","event","useImperativeHandle","focus","_inputRef$current","useEffect","labelPosition","useMemo","bottom","right","left","top","createElement","StyledInput","className","StyledInputIconWrapper","StyledInputContent","StyledInputField","disabled","autoFocus","StyledMotionInputLabel","animate","scale","initial","layout","style","originX","originY","transition","StyledMotionInputClearIcon","opacity","onClick","icons","displayName","_default","exports"],"sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import React, {\n ChangeEvent,\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n HTMLInputTypeAttribute,\n KeyboardEventHandler,\n ReactNode,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport Icon from '../icon/Icon';\nimport {\n StyledInput,\n StyledInputContent,\n StyledInputField,\n StyledInputIconWrapper,\n StyledMotionInputClearIcon,\n StyledMotionInputLabel,\n} from './Input.styles';\n\nexport type InputRef = {\n focus: VoidFunction;\n};\n\nexport type InputProps = {\n /**\n * Icon element to be displayed on the left side of the input field\n */\n iconElement?: ReactNode;\n /**\n * Disables the input so that it cannot be changed anymore\n */\n isDisabled?: boolean;\n /**\n * Function that is executed when the input field loses focus\n */\n onBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when the text of the input changes\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when the input field is focused\n */\n onFocus?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when a letter is pressed\n */\n onKeyDown?: KeyboardEventHandler<HTMLInputElement>;\n /**\n * Placeholder for the input field\n */\n placeholder?: string;\n /**\n * Element to be displayed next to or instead of the \"placeholder\"\n */\n placeholderElement?: ReactNode;\n /**\n * If true, a clear icon is displayed at the end of the input field\n */\n shouldShowClearIcon?: boolean;\n /**\n * Input type set for input element (e.g. 'text', 'number' or 'password')\n */\n type?: HTMLInputTypeAttribute;\n /**\n * Value if the input field should be controlled\n */\n value?: string;\n /**\n * If true, the input field is focused when the component is mounted\n */\n shouldUseAutoFocus?: boolean;\n};\n\nconst Input = forwardRef<InputRef, InputProps>(\n (\n {\n iconElement,\n isDisabled,\n onBlur,\n onChange,\n onFocus,\n onKeyDown,\n placeholder,\n placeholderElement,\n shouldShowClearIcon = false,\n type = 'text',\n value,\n shouldUseAutoFocus = false,\n },\n ref\n ) => {\n const [hasValue, setHasValue] = useState(typeof value === 'string' && value !== '');\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleClearIconClick = useCallback(() => {\n if (inputRef.current) {\n inputRef.current.value = '';\n\n if (typeof onChange === 'function') {\n onChange({ target: inputRef.current } as ChangeEvent<HTMLInputElement>);\n }\n }\n }, [onChange]);\n\n const handleInputFieldChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n setHasValue(event.target.value !== '');\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n },\n [onChange]\n );\n\n useImperativeHandle(\n ref,\n () => ({\n focus: () => inputRef.current?.focus(),\n }),\n []\n );\n\n useEffect(() => {\n if (typeof value === 'string') {\n setHasValue(value !== '');\n }\n }, [value]);\n\n const labelPosition = useMemo(() => {\n if (hasValue) {\n return { bottom: -8, right: -6 };\n }\n\n return { left: 0, top: 0 };\n }, [hasValue]);\n\n return (\n <StyledInput className=\"beta-chayns-input\" isDisabled={isDisabled}>\n {iconElement && <StyledInputIconWrapper>{iconElement}</StyledInputIconWrapper>}\n <StyledInputContent>\n <StyledInputField\n disabled={isDisabled}\n onBlur={onBlur}\n onChange={handleInputFieldChange}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n ref={inputRef}\n type={type}\n value={value}\n autoFocus={shouldUseAutoFocus}\n />\n <StyledMotionInputLabel\n animate={{ scale: hasValue ? 0.6 : 1 }}\n initial={false}\n layout\n style={{ ...labelPosition, originX: 1, originY: 1 }}\n transition={{ type: 'tween' }}\n >\n {placeholderElement}\n {placeholder}\n </StyledMotionInputLabel>\n </StyledInputContent>\n {shouldShowClearIcon && (\n <StyledMotionInputClearIcon\n animate={{ opacity: hasValue ? 1 : 0 }}\n initial={false}\n onClick={handleClearIconClick}\n transition={{ type: 'tween' }}\n >\n <Icon icons={['fa fa-times']} />\n </StyledMotionInputClearIcon>\n )}\n </StyledInput>\n );\n }\n);\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAeA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAOwB,SAAAE,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAT,wBAAAK,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAhB,GAAA,QAAAgB,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAnB,GAAA,EAAA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GAEb3D,KAAK;AAAA4D,OAAA,CAAAhF,OAAA,GAAA+E,QAAA"}
package/lib/index.d.ts CHANGED
@@ -39,10 +39,6 @@ export { default as SharingBar } from './components/sharing-bar/SharingBar';
39
39
  export { default as Slider } from './components/slider/Slider';
40
40
  export { default as SmallWaitCursor, SmallWaitCursorSize, SmallWaitCursorSpeed, } from './components/small-wait-cursor/SmallWaitCursor';
41
41
  export { default as TextArea } from './components/text-area/TextArea';
42
- export { default as TextStringProvider } from './components/textstring-provider/TextStringProvider';
43
- export { default as TextString } from './components/textstring/TextString';
44
- export type { ITextstring as Textstring, TextstringReplacement, } from './components/textstring/types';
45
- export { getTextstringValue } from './utils/textstring';
46
42
  export { default as Tooltip } from './components/tooltip/Tooltip';
47
43
  export type { FileItem, Image, Meta, Video } from './types/file';
48
44
  export { selectFiles } from './utils/fileDialog';
package/lib/index.js CHANGED
@@ -225,30 +225,12 @@ Object.defineProperty(exports, "TextArea", {
225
225
  return _TextArea.default;
226
226
  }
227
227
  });
228
- Object.defineProperty(exports, "TextString", {
229
- enumerable: true,
230
- get: function () {
231
- return _TextString.default;
232
- }
233
- });
234
- Object.defineProperty(exports, "TextStringProvider", {
235
- enumerable: true,
236
- get: function () {
237
- return _TextStringProvider.default;
238
- }
239
- });
240
228
  Object.defineProperty(exports, "Tooltip", {
241
229
  enumerable: true,
242
230
  get: function () {
243
231
  return _Tooltip.default;
244
232
  }
245
233
  });
246
- Object.defineProperty(exports, "getTextstringValue", {
247
- enumerable: true,
248
- get: function () {
249
- return _textstring.getTextstringValue;
250
- }
251
- });
252
234
  Object.defineProperty(exports, "isTobitEmployee", {
253
235
  enumerable: true,
254
236
  get: function () {
@@ -302,9 +284,6 @@ var _SharingBar = _interopRequireDefault(require("./components/sharing-bar/Shari
302
284
  var _Slider = _interopRequireDefault(require("./components/slider/Slider"));
303
285
  var _SmallWaitCursor = _interopRequireWildcard(require("./components/small-wait-cursor/SmallWaitCursor"));
304
286
  var _TextArea = _interopRequireDefault(require("./components/text-area/TextArea"));
305
- var _TextStringProvider = _interopRequireDefault(require("./components/textstring-provider/TextStringProvider"));
306
- var _TextString = _interopRequireDefault(require("./components/textstring/TextString"));
307
- var _textstring = require("./utils/textstring");
308
287
  var _Tooltip = _interopRequireDefault(require("./components/tooltip/Tooltip"));
309
288
  var _fileDialog = require("./utils/fileDialog");
310
289
  var _isTobitEmployee = require("./utils/isTobitEmployee");
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_ComboBox","_ContentCard","_ContextMenu","_DateInfo","_FilterButton","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_alignment","_MentionFinder","_NumberInput","_Popup","_ProgressBar","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SharingBar","_Slider","_SmallWaitCursor","_interopRequireWildcard","_TextArea","_TextStringProvider","_TextString","_textstring","_Tooltip","_fileDialog","_isTobitEmployee","_uploadFile","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sources":["../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type { WithTheme } from './components/color-scheme-provider/ColorSchemeProvider';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport type { IComboBoxItem as ComboBoxItem } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport { default as DateInfo } from './components/date-info/DateInfo';\nexport { default as FilterButton } from './components/filter-button/FilterButton';\nexport type {\n FilterButtonItemShape,\n FilterButtonSize,\n IFilterButtonItem as FilterButtonItem,\n} from './components/filter-button/types';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport { default as ListItem } from './components/list/list-item/ListItem';\nexport { MentionFinderPopupAlignment } from './components/mention-finder/constants/alignment';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as Popup } from './components/popup/Popup';\nexport type { PopupRef } from './components/popup/types';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { default as RadioButtonGroup } from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport type { ISearchBoxItem as SearchBoxItem } from './components/search-box/types';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as TextStringProvider } from './components/textstring-provider/TextStringProvider';\nexport { default as TextString } from './components/textstring/TextString';\nexport type {\n ITextstring as Textstring,\n TextstringReplacement,\n} from './components/textstring/types';\nexport { getTextstringValue } from './utils/textstring';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport type { FileItem, Image, Meta, Video } from './types/file';\nexport { selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { uploadFile } from './utils/uploadFile';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,eAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,MAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,OAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,SAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,oBAAA,GAAAV,sBAAA,CAAAC,OAAA;AAEA,IAAAU,SAAA,GAAAX,sBAAA,CAAAC,OAAA;AAEA,IAAAW,YAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,YAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,SAAA,GAAAd,sBAAA,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GAAA,KAAAE,OAAA,EAAAF,GAAA"}
1
+ {"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_ComboBox","_ContentCard","_ContextMenu","_DateInfo","_FilterButton","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_alignment","_MentionFinder","_NumberInput","_Popup","_ProgressBar","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SharingBar","_Slider","_SmallWaitCursor","_interopRequireWildcard","_TextArea","_Tooltip","_fileDialog","_isTobitEmployee","_uploadFile","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sources":["../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type { WithTheme } from './components/color-scheme-provider/ColorSchemeProvider';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport type { IComboBoxItem as ComboBoxItem } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport { default as DateInfo } from './components/date-info/DateInfo';\nexport { default as FilterButton } from './components/filter-button/FilterButton';\nexport type {\n FilterButtonItemShape,\n FilterButtonSize,\n IFilterButtonItem as FilterButtonItem,\n} from './components/filter-button/types';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport { default as ListItem } from './components/list/list-item/ListItem';\nexport { MentionFinderPopupAlignment } from './components/mention-finder/constants/alignment';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as Popup } from './components/popup/Popup';\nexport type { PopupRef } from './components/popup/types';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { default as RadioButtonGroup } from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport type { ISearchBoxItem as SearchBoxItem } from './components/search-box/types';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport type { FileItem, Image, Meta, Video } from './types/file';\nexport { selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { uploadFile } from './utils/uploadFile';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAAA,SAAApD,uBAAA8C,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/core",
3
- "version": "5.0.0-beta.244",
3
+ "version": "5.0.0-beta.249",
4
4
  "description": "A set of beautiful React components for developing your own applications with chayns.",
5
5
  "keywords": [
6
6
  "chayns",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "49f861ccc526feeeb6dadb13a530f10d788e59bf"
68
+ "gitHead": "b4a1c3c2662c060c621b91260f2fe3f053259504"
69
69
  }
@@ -1,26 +0,0 @@
1
- import { CSSProperties, FC, ReactHTML, ReactNode } from 'react';
2
- import type { ITextstring, TextstringReplacement } from './types';
3
- export type TextStringProps = {
4
- /**
5
- * The element that the text should be displayed in.
6
- */
7
- children?: ReactNode;
8
- /**
9
- * The styles of the HTML element that the text should be displayed in.
10
- */
11
- childrenStyles?: CSSProperties;
12
- /**
13
- * The tag of the HTML element that the text should be displayed in.
14
- */
15
- childrenTagName?: keyof ReactHTML;
16
- /**
17
- * A part of the text that should be replaced.
18
- */
19
- replacements?: TextstringReplacement[];
20
- /**
21
- * The text that should be displayed.
22
- */
23
- textString: ITextstring;
24
- };
25
- declare const TextString: FC<TextStringProps>;
26
- export default TextString;
@@ -1,68 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _isTobitEmployee = require("../../utils/isTobitEmployee");
9
- var _TextStringProvider = require("../textstring-provider/TextStringProvider");
10
- var _utils = require("../textstring-provider/utils");
11
- var _TextString = require("./TextString.styles");
12
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
- const TextString = _ref => {
15
- let {
16
- textString,
17
- replacements,
18
- childrenTagName,
19
- children,
20
- childrenStyles
21
- } = _ref;
22
- const textStrings = (0, _react.useContext)(_TextStringProvider.TextStringContext);
23
- const text = (0, _react.useMemo)(() => {
24
- var _textStrings$textStri;
25
- const value = (_textStrings$textStri = textStrings[textString.name]) !== null && _textStrings$textStri !== void 0 ? _textStrings$textStri : textString.fallback;
26
- if (!replacements) {
27
- return value;
28
- }
29
- let newValue = value;
30
- replacements.forEach(_ref2 => {
31
- let {
32
- replacement,
33
- key
34
- } = _ref2;
35
- newValue = newValue.replace(key, replacement);
36
- });
37
- return newValue;
38
- }, [replacements, textString, textStrings]);
39
- const childElement = (0, _react.useMemo)(() => {
40
- let element = /*#__PURE__*/(0, _react.createElement)('', childrenStyles ? {
41
- style: childrenStyles
42
- } : null, children);
43
- if (!children) {
44
- element = /*#__PURE__*/(0, _react.createElement)(childrenTagName || 'span', childrenStyles ? {
45
- style: childrenStyles
46
- } : null, text);
47
- }
48
- return element;
49
- }, [children, childrenStyles, childrenTagName, text]);
50
- const handleClick = (0, _react.useCallback)(event => {
51
- if (event.ctrlKey) {
52
- void (0, _isTobitEmployee.isTobitEmployee)().then(inGroup => {
53
- if (inGroup) {
54
- (0, _utils.selectLanguageToChange)({
55
- textstringName: textString.name
56
- });
57
- }
58
- });
59
- }
60
- }, [textString.name]);
61
- return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_TextString.StyledTextString, {
62
- onClick: handleClick
63
- }, childElement), [childElement, handleClick]);
64
- };
65
- TextString.displayName = 'TextString';
66
- var _default = TextString;
67
- exports.default = _default;
68
- //# sourceMappingURL=TextString.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextString.js","names":["_react","_interopRequireWildcard","require","_isTobitEmployee","_TextStringProvider","_utils","_TextString","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TextString","_ref","textString","replacements","childrenTagName","children","childrenStyles","textStrings","useContext","TextStringContext","text","useMemo","_textStrings$textStri","value","name","fallback","newValue","forEach","_ref2","replacement","replace","childElement","element","createElement","style","handleClick","useCallback","event","ctrlKey","isTobitEmployee","then","inGroup","selectLanguageToChange","textstringName","StyledTextString","onClick","displayName","_default","exports"],"sources":["../../../src/components/textstring/TextString.tsx"],"sourcesContent":["import React, {\n createElement,\n CSSProperties,\n FC,\n MouseEventHandler,\n ReactHTML,\n ReactNode,\n useCallback,\n useContext,\n useMemo,\n} from 'react';\nimport { isTobitEmployee } from '../../utils/isTobitEmployee';\nimport { TextStringContext } from '../textstring-provider/TextStringProvider';\nimport { selectLanguageToChange } from '../textstring-provider/utils';\nimport { StyledTextString } from './TextString.styles';\nimport type { ITextstring, TextstringReplacement } from './types';\n\nexport type TextStringProps = {\n /**\n * The element that the text should be displayed in.\n */\n children?: ReactNode;\n /**\n * The styles of the HTML element that the text should be displayed in.\n */\n childrenStyles?: CSSProperties;\n /**\n * The tag of the HTML element that the text should be displayed in.\n */\n childrenTagName?: keyof ReactHTML;\n /**\n * A part of the text that should be replaced.\n */\n replacements?: TextstringReplacement[];\n /**\n * The text that should be displayed.\n */\n textString: ITextstring;\n};\n\nconst TextString: FC<TextStringProps> = ({\n textString,\n replacements,\n childrenTagName,\n children,\n childrenStyles,\n}) => {\n const textStrings = useContext(TextStringContext);\n\n const text = useMemo(() => {\n const value = textStrings[textString.name] ?? textString.fallback;\n\n if (!replacements) {\n return value;\n }\n\n let newValue = value;\n\n replacements.forEach(({ replacement, key }) => {\n newValue = newValue.replace(key, replacement);\n });\n\n return newValue;\n }, [replacements, textString, textStrings]);\n\n const childElement = useMemo(() => {\n let element = createElement(\n '',\n childrenStyles ? { style: childrenStyles } : null,\n children\n );\n\n if (!children) {\n element = createElement(\n childrenTagName || 'span',\n childrenStyles ? { style: childrenStyles } : null,\n text\n );\n }\n\n return element;\n }, [children, childrenStyles, childrenTagName, text]);\n\n const handleClick: MouseEventHandler<HTMLDivElement> = useCallback(\n (event) => {\n if (event.ctrlKey) {\n void isTobitEmployee().then((inGroup) => {\n if (inGroup) {\n selectLanguageToChange({\n textstringName: textString.name,\n });\n }\n });\n }\n },\n [textString.name]\n );\n\n return useMemo(\n () => <StyledTextString onClick={handleClick}>{childElement}</StyledTextString>,\n [childElement, handleClick]\n );\n};\n\nTextString.displayName = 'TextString';\n\nexport default TextString;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAWA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAAuD,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAW,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAA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AO,gBAAG,IAAAC,oBAAa,EACnBnB,eAAe,IAAI,MAAM,EACzBE,cAAc,GAAG;QAAEkB,KAAK,EAAElB;MAAe,CAAC,GAAG,IAAI,EACjDI,IACJ,CAAC;IACL;IAEA,OAAOY,OAAO;EAClB,CAAC,EAAE,CAACjB,QAAQ,EAAEC,cAAc,EAAEF,eAAe,EAAEM,IAAI,CAAC,CAAC;EAErD,MAAMe,WAA8C,GAAG,IAAAC,kBAAW,EAC7DC,KAAK,IAAK;IACP,IAAIA,KAAK,CAACC,OAAO,EAAE;MACf,KAAK,IAAAC,gCAAe,EAAC,CAAC,CAACC,IAAI,CAAEC,OAAO,IAAK;QACrC,IAAIA,OAAO,EAAE;UACT,IAAAC,6BAAsB,EAAC;YACnBC,cAAc,EAAE/B,UAAU,CAACY;UAC/B,CAAC,CAAC;QACN;MACJ,CAAC,CAAC;IACN;EACJ,CAAC,EACD,CAACZ,UAAU,CAACY,IAAI,CACpB,CAAC;EAED,OAAO,IAAAH,cAAO,EACV,mBAAMxC,MAAA,CAAAc,OAAA,CAAAsC,aAAA,CAAC9C,WAAA,CAAAyD,gBAAgB;IAACC,OAAO,EAAEV;EAAY,GAAEJ,YAA+B,CAAC,EAC/E,CAACA,YAAY,EAAEI,WAAW,CAC9B,CAAC;AACL,CAAC;AAEDzB,UAAU,CAACoC,WAAW,GAAG,YAAY;AAAC,IAAAC,QAAA,GAEvBrC,UAAU;AAAAsC,OAAA,CAAArD,OAAA,GAAAoD,QAAA"}
@@ -1 +0,0 @@
1
- export declare const StyledTextString: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.StyledTextString = void 0;
7
- var _styledComponents = _interopRequireDefault(require("styled-components"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- const StyledTextString = _styledComponents.default.div``;
10
- exports.StyledTextString = StyledTextString;
11
- //# sourceMappingURL=TextString.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextString.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledTextString","styled","div","exports"],"sources":["../../../src/components/textstring/TextString.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledTextString = styled.div``;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhC,MAAMG,gBAAgB,GAAGC,yBAAM,CAACC,GAAI,EAAC;AAACC,OAAA,CAAAH,gBAAA,GAAAA,gBAAA"}
@@ -1,8 +0,0 @@
1
- export interface TextstringReplacement {
2
- key: string;
3
- replacement: string;
4
- }
5
- export interface ITextstring {
6
- fallback: string;
7
- name: string;
8
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/components/textstring/types.ts"],"sourcesContent":["export interface TextstringReplacement {\n key: string;\n replacement: string;\n}\n\nexport interface ITextstring {\n fallback: string;\n name: string;\n}\n"],"mappings":""}
@@ -1,21 +0,0 @@
1
- import React, { FC, ReactNode } from 'react';
2
- export type TextStringValue = {
3
- [key: string]: string;
4
- };
5
- export declare const TextStringContext: React.Context<TextStringValue>;
6
- export type TextStringProviderProps = {
7
- /**
8
- * The element that should use the library.
9
- */
10
- children?: ReactNode;
11
- /**
12
- * The language that should be used.
13
- */
14
- language: string;
15
- /**
16
- * The name of the library.
17
- */
18
- libraryName: string;
19
- };
20
- declare const TextStringProvider: FC<TextStringProviderProps>;
21
- export default TextStringProvider;
@@ -1,39 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.TextStringContext = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _utils = require("./utils");
9
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
- const TextStringContext = /*#__PURE__*/(0, _react.createContext)({});
12
- exports.TextStringContext = TextStringContext;
13
- const TextStringProvider = _ref => {
14
- let {
15
- children,
16
- libraryName,
17
- language
18
- } = _ref;
19
- const [textStrings, setTextStrings] = (0, _react.useState)({});
20
- (0, _react.useEffect)(() => {
21
- const loadData = async () => {
22
- const textStringResult = await (0, _utils.loadLibrary)({
23
- libraryName,
24
- language
25
- });
26
- if (textStringResult) {
27
- setTextStrings(textStringResult);
28
- }
29
- };
30
- void loadData();
31
- }, [language, libraryName]);
32
- return /*#__PURE__*/_react.default.createElement(TextStringContext.Provider, {
33
- value: textStrings
34
- }, children);
35
- };
36
- TextStringProvider.displayName = 'TextStringProvider';
37
- var _default = TextStringProvider;
38
- exports.default = _default;
39
- //# sourceMappingURL=TextStringProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextStringProvider.js","names":["_react","_interopRequireWildcard","require","_utils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TextStringContext","createContext","exports","TextStringProvider","_ref","children","libraryName","language","textStrings","setTextStrings","useState","useEffect","loadData","textStringResult","loadLibrary","createElement","Provider","value","displayName","_default"],"sources":["../../../src/components/textstring-provider/TextStringProvider.tsx"],"sourcesContent":["import React, { createContext, FC, ReactNode, useEffect, useState } from 'react';\nimport { loadLibrary } from './utils';\n\nexport type TextStringValue = {\n [key: string]: string;\n};\n\nexport const TextStringContext = createContext<TextStringValue>({});\n\nexport type TextStringProviderProps = {\n /**\n * The element that should use the library.\n */\n children?: ReactNode;\n /**\n * The language that should be used.\n */\n language: string;\n /**\n * The name of the library.\n */\n libraryName: string;\n};\n\nconst TextStringProvider: FC<TextStringProviderProps> = ({ children, libraryName, language }) => {\n const [textStrings, setTextStrings] = useState<TextStringValue>({});\n\n useEffect(() => {\n const loadData = async () => {\n const textStringResult = await loadLibrary({ libraryName, language });\n\n if (textStringResult) {\n setTextStrings(textStringResult);\n }\n };\n\n void loadData();\n }, [language, libraryName]);\n\n return <TextStringContext.Provider value={textStrings}>{children}</TextStringContext.Provider>;\n};\n\nTextStringProvider.displayName = 'TextStringProvider';\n\nexport default TextStringProvider;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAsC,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WA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AQ,GAAG,MAAAA,CAAA,KAAY;MACzB,MAAMC,gBAAgB,GAAG,MAAM,IAAAC,kBAAW,EAAC;QAAER,WAAW;QAAEC;MAAS,CAAC,CAAC;MAErE,IAAIM,gBAAgB,EAAE;QAClBJ,cAAc,CAACI,gBAAgB,CAAC;MACpC;IACJ,CAAC;IAED,KAAKD,QAAQ,CAAC,CAAC;EACnB,CAAC,EAAE,CAACL,QAAQ,EAAED,WAAW,CAAC,CAAC;EAE3B,oBAAOhC,MAAA,CAAAW,OAAA,CAAA8B,aAAA,CAACf,iBAAiB,CAACgB,QAAQ;IAACC,KAAK,EAAET;EAAY,GAAEH,QAAqC,CAAC;AAClG,CAAC;AAEDF,kBAAkB,CAACe,WAAW,GAAG,oBAAoB;AAAC,IAAAC,QAAA,GAEvChB,kBAAkB;AAAAD,OAAA,CAAAjB,OAAA,GAAAkC,QAAA"}
@@ -1,11 +0,0 @@
1
- import type { TextStringValue } from './TextStringProvider';
2
- interface LoadLibraryOptions {
3
- libraryName: string;
4
- language: string;
5
- }
6
- export declare const loadLibrary: ({ language, libraryName }: LoadLibraryOptions) => Promise<TextStringValue | null>;
7
- interface SelectLanguageToChangeOptions {
8
- textstringName: string;
9
- }
10
- export declare const selectLanguageToChange: ({ textstringName }: SelectLanguageToChangeOptions) => void;
11
- export {};
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.selectLanguageToChange = exports.loadLibrary = void 0;
7
- const loadLibrary = async _ref => {
8
- let {
9
- language,
10
- libraryName
11
- } = _ref;
12
- const response = await fetch(`https://webapi.tobit.com/TextStringService/v1.0/LangStrings/${libraryName}?language=${language}`);
13
- if (response.status !== 200) {
14
- return null;
15
- }
16
- return await response.json();
17
- };
18
- exports.loadLibrary = loadLibrary;
19
- const selectLanguageToChange = _ref2 => {
20
- let {
21
- textstringName
22
- } = _ref2;
23
- void chayns.dialog.iFrame({
24
- url: 'https://tapp-staging.chayns-static.space/text-string-tapp/v1/iframe-edit.html',
25
- buttons: [],
26
- input: {
27
- textstring: textstringName
28
- }
29
- });
30
- };
31
- exports.selectLanguageToChange = selectLanguageToChange;
32
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","names":["loadLibrary","_ref","language","libraryName","response","fetch","status","json","exports","selectLanguageToChange","_ref2","textstringName","chayns","dialog","iFrame","url","buttons","input","textstring"],"sources":["../../../src/components/textstring-provider/utils.ts"],"sourcesContent":["import type { TextStringValue } from './TextStringProvider';\n\ninterface LoadLibraryOptions {\n libraryName: string;\n language: string;\n}\n\nexport const loadLibrary = async ({ language, libraryName }: LoadLibraryOptions) => {\n const response = await fetch(\n `https://webapi.tobit.com/TextStringService/v1.0/LangStrings/${libraryName}?language=${language}`\n );\n\n if (response.status !== 200) {\n return null;\n }\n\n return (await response.json()) as TextStringValue;\n};\n\ninterface SelectLanguageToChangeOptions {\n textstringName: string;\n}\n\nexport const selectLanguageToChange = ({ textstringName }: SelectLanguageToChangeOptions) => {\n void chayns.dialog.iFrame({\n url: 'https://tapp-staging.chayns-static.space/text-string-tapp/v1/iframe-edit.html',\n buttons: [],\n input: { textstring: textstringName },\n });\n};\n"],"mappings":";;;;;;AAOO,MAAMA,WAAW,GAAG,MAAAC,IAAA,IAAyD;EAAA,IAAlD;IAAEC,QAAQ;IAAEC;EAAgC,CAAC,GAAAF,IAAA;EAC3E,MAAMG,QAAQ,GAAG,MAAMC,KAAK,CACvB,+DAA8DF,WAAY,aAAYD,QAAS,EACpG,CAAC;EAED,IAAIE,QAAQ,CAACE,MAAM,KAAK,GAAG,EAAE;IACzB,OAAO,IAAI;EACf;EAEA,OAAQ,MAAMF,QAAQ,CAACG,IAAI,CAAC,CAAC;AACjC,CAAC;AAACC,OAAA,CAAAR,WAAA,GAAAA,WAAA;AAMK,MAAMS,sBAAsB,GAAGC,KAAA,IAAuD;EAAA,IAAtD;IAAEC;EAA8C,CAAC,GAAAD,KAAA;EACpF,KAAKE,MAAM,CAACC,MAAM,CAACC,MAAM,CAAC;IACtBC,GAAG,EAAE,+EAA+E;IACpFC,OAAO,EAAE,EAAE;IACXC,KAAK,EAAE;MAAEC,UAAU,EAAEP;IAAe;EACxC,CAAC,CAAC;AACN,CAAC;AAACH,OAAA,CAAAC,sBAAA,GAAAA,sBAAA"}
@@ -1,6 +0,0 @@
1
- import type { ITextstring, TextstringReplacement } from '../components/textstring/types';
2
- export interface GetTextstringValue {
3
- textString: ITextstring;
4
- replacements?: TextstringReplacement[];
5
- }
6
- export declare const getTextstringValue: ({ replacements, textString }: GetTextstringValue) => string;
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getTextstringValue = void 0;
7
- var _react = require("react");
8
- var _TextStringProvider = require("../components/textstring-provider/TextStringProvider");
9
- const getTextstringValue = _ref => {
10
- var _textStrings$textStri;
11
- let {
12
- replacements,
13
- textString
14
- } = _ref;
15
- // Ignore rule to get the textstrings from the library
16
- // eslint-disable-next-line react-hooks/rules-of-hooks
17
- const textStrings = (0, _react.useContext)(_TextStringProvider.TextStringContext);
18
- const value = (_textStrings$textStri = textStrings[textString.name]) !== null && _textStrings$textStri !== void 0 ? _textStrings$textStri : textString.fallback;
19
- if (!replacements) {
20
- return value;
21
- }
22
- let newValue = value;
23
- replacements.forEach(_ref2 => {
24
- let {
25
- replacement,
26
- key
27
- } = _ref2;
28
- newValue = newValue.replace(key, replacement);
29
- });
30
- return newValue;
31
- };
32
- exports.getTextstringValue = getTextstringValue;
33
- //# sourceMappingURL=textstring.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"textstring.js","names":["_react","require","_TextStringProvider","getTextstringValue","_ref","_textStrings$textStri","replacements","textString","textStrings","useContext","TextStringContext","value","name","fallback","newValue","forEach","_ref2","replacement","key","replace","exports"],"sources":["../../src/utils/textstring.ts"],"sourcesContent":["import type { ITextstring, TextstringReplacement } from '../components/textstring/types';\nimport { useContext } from 'react';\nimport { TextStringContext } from '../components/textstring-provider/TextStringProvider';\n\nexport interface GetTextstringValue {\n textString: ITextstring;\n replacements?: TextstringReplacement[];\n}\n\nexport const getTextstringValue = ({ replacements, textString }: GetTextstringValue) => {\n // Ignore rule to get the textstrings from the library\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const textStrings = useContext(TextStringContext);\n\n const value = textStrings[textString.name] ?? textString.fallback;\n\n if (!replacements) {\n return value;\n }\n\n let newValue = value;\n\n replacements.forEach(({ replacement, key }) => {\n newValue = newValue.replace(key, replacement);\n });\n\n return newValue;\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAOO,MAAME,kBAAkB,GAAGC,IAAA,IAAsD;EAAA,IAAAC,qBAAA;EAAA,IAArD;IAAEC,YAAY;IAAEC;EAA+B,CAAC,GAAAH,IAAA;EAC/E;EACA;EACA,MAAMI,WAAW,GAAG,IAAAC,iBAAU,EAACC,qCAAiB,CAAC;EAEjD,MAAMC,KAAK,IAAAN,qBAAA,GAAGG,WAAW,CAACD,UAAU,CAACK,IAAI,CAAC,cAAAP,qBAAA,cAAAA,qBAAA,GAAIE,UAAU,CAACM,QAAQ;EAEjE,IAAI,CAACP,YAAY,EAAE;IACf,OAAOK,KAAK;EAChB;EAEA,IAAIG,QAAQ,GAAGH,KAAK;EAEpBL,YAAY,CAACS,OAAO,CAACC,KAAA,IAA0B;IAAA,IAAzB;MAAEC,WAAW;MAAEC;IAAI,CAAC,GAAAF,KAAA;IACtCF,QAAQ,GAAGA,QAAQ,CAACK,OAAO,CAACD,GAAG,EAAED,WAAW,CAAC;EACjD,CAAC,CAAC;EAEF,OAAOH,QAAQ;AACnB,CAAC;AAACM,OAAA,CAAAjB,kBAAA,GAAAA,kBAAA"}