@talxis/base-controls 1.2411.4 → 1.2411.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DateTime/hooks/useDateTime.js +1 -1
- package/dist/components/DateTime/hooks/useDateTime.js.map +1 -1
- package/dist/components/Grid/core/controllers/useGridController.js +2 -2
- package/dist/components/Grid/core/controllers/useGridController.js.map +1 -1
- package/dist/hooks/useControl.js +1 -2
- package/dist/hooks/useControl.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@ import { useRef, useEffect } from 'react';
|
|
|
2
2
|
import { useInputBasedControl } from '../../../hooks/useInputBasedControl.js';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
import utc from 'dayjs/plugin/utc';
|
|
5
|
+
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
5
6
|
import { getDefaultDateTimeTranslations } from '../translations.js';
|
|
6
7
|
|
|
7
|
-
const customParseFormat = require("dayjs/plugin/customParseFormat");
|
|
8
8
|
dayjs.extend(customParseFormat);
|
|
9
9
|
dayjs.extend(utc);
|
|
10
10
|
const useDateTime = (props, ref) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDateTime.js","sources":["../../../../src/components/DateTime/hooks/useDateTime.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport { useInputBasedControl } from \"../../../hooks/useInputBasedControl\";\nimport { IDateTime, IDateTimeOutputs, IDateTimeParameters} from \"../interfaces\";\nimport dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\nimport { getDefaultDateTimeTranslations } from \"../translations\";\nimport {ITranslation } from \"../../../hooks\";\nimport { ITheme } from \"../../../interfaces/theme\";\n\n\nconst customParseFormat = require(\"dayjs/plugin/customParseFormat\");\ndayjs.extend(customParseFormat);\ndayjs.extend(utc);\n\nexport const useDateTime = (props: IDateTime, ref: React.RefObject<HTMLDivElement>): [\n boolean,\n ITheme,\n ITranslation<Required<IDateTime>['translations']>,\n {\n get: () => Date | undefined;\n getFormatted: () => string | undefined;\n set: (date?: Date, time?: string) => void;\n setDateString: (value: string | undefined) => void;\n clear: () => void;\n },\n {\n shortDatePattern: string\n shortTimePattern: string;\n fullDateTimePattern: string;\n },\n] => {\n\n const boundValue = props.parameters.value;\n const context = props.context;\n const behavior = boundValue.attributes.Behavior;\n const format = boundValue.attributes.Format;\n const dateFormattingInfo = context.userSettings.dateFormattingInfo;\n const lastValidDateRef = useRef<Date | undefined>(undefined);\n \n const isDateTime = (() => {\n switch (format) {\n case 'DateAndTime':\n case 'Date and Time':\n case 'DateAndTime.DateAndTime':\n case 'datetime': {\n return true;\n }\n default: {\n return false;\n }\n }\n })();\n\n //MS returns the pattern without correct separator and they do this during formatting\n const shortDatePattern = dateFormattingInfo.shortDatePattern.replace(/\\//g, dateFormattingInfo.dateSeparator).toUpperCase();\n const shortTimePattern = dateFormattingInfo.shortTimePattern.replace(/:/g, dateFormattingInfo.timeSeparator).replace('tt', 'A');\n const formatting = (() => {\n if (isDateTime) {\n return `${shortDatePattern} ${shortTimePattern}`;\n }\n return shortDatePattern;\n })();\n\n const formatDate = (date: Date | undefined | null | string): string | undefined | null => {\n if (date instanceof Date) {\n if (isDateTime) {\n //should handle the time zone conversion\n return context.formatting.formatTime(date, behavior);\n }\n return context.formatting.formatDateShort(date);\n }\n return date;\n };\n\n const {value, labels, theme, setValue, onNotifyOutputChanged} = useInputBasedControl<string | undefined, IDateTimeParameters, IDateTimeOutputs, Required<IDateTime>['translations']>('DateTime', props, {\n formatter: formatDate,\n defaultTranslations: getDefaultDateTimeTranslations(props.context.userSettings.dateFormattingInfo)\n });\n\n useEffect(() => {\n const onBlur = () => {\n onNotifyOutputChanged({\n value: dateExtractor(value!) as any\n });\n };\n const input = ref.current?.querySelector('input');\n input?.addEventListener('blur', onBlur);\n return () => {\n input?.removeEventListener('blur', onBlur);\n };\n }, [value]);\n\n useEffect(() => {\n if (boundValue.raw instanceof Date) {\n lastValidDateRef.current = boundValue.raw;\n }\n }, [boundValue.raw]);\n\n const getDate = (): Date | undefined => {\n if (boundValue.raw instanceof Date) {\n if (behavior === 3) {\n //the date in javascript gets automatically adjusted to local time zone\n //this will make it think that the date already came in local time, thus not adjusting the time\n const date = new Date(boundValue.raw.toISOString().replace('Z', ''));\n return date;\n }\n return boundValue.raw;\n }\n if(boundValue.error) {\n return lastValidDateRef.current;\n }\n return undefined;\n };\n\n const dateExtractor = (value: string | Date): Date | string => {\n if (value instanceof Date) {\n return value;\n }\n const dayjsDate = dayjs(value, formatting, true);\n if (!dayjsDate.isValid()) {\n const dayJsDateNoWhiteSpace = dayjs(value?.replaceAll(' ', ''), formatting.replaceAll(' ', ''));\n if(!dayJsDateNoWhiteSpace.isValid()) {\n return value;\n }\n else {\n return dayJsDateNoWhiteSpace.toDate();\n }\n }\n return dayjsDate.toDate();\n };\n\n const clearDate = () => {\n onNotifyOutputChanged({\n value: undefined\n });\n };\n\n const selectDate = (date?: Date, time?: string) => {\n //onSelectDate can trigger on initial click with empty date, do not continue in this case\n //for clearing dates, date.clear should be used\n if(!date && !time) {\n return;\n }\n let dayjsDate = dayjs(date ?? getDate());\n //date selected from calendar, keep the original time\n if (!time) {\n time = dayjs(getDate()).format(shortTimePattern);\n }\n const dayjsTime = dayjs(time, shortTimePattern, true);\n let invalidDateString;\n if(!dayjsTime.isValid()) {\n invalidDateString = `${dayjsDate.format(shortDatePattern)} ${time}`\n }\n dayjsDate = dayjsDate.hour(dayjsTime.hour());\n dayjsDate = dayjsDate.minute(dayjsTime.minute());\n onNotifyOutputChanged({\n value: dateExtractor(invalidDateString ?? dayjsDate.toDate()) as any\n });\n };\n return [\n isDateTime,\n theme,\n labels,\n {\n get: getDate,\n clear: clearDate,\n getFormatted: () => value,\n set: selectDate,\n setDateString: setValue\n },\n {\n shortDatePattern: shortDatePattern,\n shortTimePattern: shortTimePattern,\n fullDateTimePattern: `${shortDatePattern} ${shortTimePattern}`\n }\n ]\n};"],"names":[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;AACP,KAAC,CAAC;IACF,OAAO;QACH,UAAU;QACV,KAAK;QACL,MAAM;AACN,QAAA;AACI,YAAA,GAAG,EAAE,OAAO;AACZ,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,YAAY,EAAE,MAAM,KAAK;AACzB,YAAA,GAAG,EAAE,UAAU;AACf,YAAA,aAAa,EAAE,QAAQ;AAC1B,SAAA;AACD,QAAA;AACI,YAAA,gBAAgB,EAAE,gBAAgB;AAClC,YAAA,gBAAgB,EAAE,gBAAgB;AAClC,YAAA,mBAAmB,EAAE,CAAA,EAAG,gBAAgB,CAAA,CAAA,EAAI,gBAAgB,CAAE,CAAA;AACjE,SAAA;KACJ,CAAA;AACL;;;;"}
|
|
1
|
+
{"version":3,"file":"useDateTime.js","sources":["../../../../src/components/DateTime/hooks/useDateTime.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport { useInputBasedControl } from \"../../../hooks/useInputBasedControl\";\nimport { IDateTime, IDateTimeOutputs, IDateTimeParameters} from \"../interfaces\";\nimport dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport { getDefaultDateTimeTranslations } from \"../translations\";\nimport {ITranslation } from \"../../../hooks\";\nimport { ITheme } from \"../../../interfaces/theme\";\n\ndayjs.extend(customParseFormat);\ndayjs.extend(utc);\n\nexport const useDateTime = (props: IDateTime, ref: React.RefObject<HTMLDivElement>): [\n boolean,\n ITheme,\n ITranslation<Required<IDateTime>['translations']>,\n {\n get: () => Date | undefined;\n getFormatted: () => string | undefined;\n set: (date?: Date, time?: string) => void;\n setDateString: (value: string | undefined) => void;\n clear: () => void;\n },\n {\n shortDatePattern: string\n shortTimePattern: string;\n fullDateTimePattern: string;\n },\n] => {\n\n const boundValue = props.parameters.value;\n const context = props.context;\n const behavior = boundValue.attributes.Behavior;\n const format = boundValue.attributes.Format;\n const dateFormattingInfo = context.userSettings.dateFormattingInfo;\n const lastValidDateRef = useRef<Date | undefined>(undefined);\n \n const isDateTime = (() => {\n switch (format) {\n case 'DateAndTime':\n case 'Date and Time':\n case 'DateAndTime.DateAndTime':\n case 'datetime': {\n return true;\n }\n default: {\n return false;\n }\n }\n })();\n\n //MS returns the pattern without correct separator and they do this during formatting\n const shortDatePattern = dateFormattingInfo.shortDatePattern.replace(/\\//g, dateFormattingInfo.dateSeparator).toUpperCase();\n const shortTimePattern = dateFormattingInfo.shortTimePattern.replace(/:/g, dateFormattingInfo.timeSeparator).replace('tt', 'A');\n const formatting = (() => {\n if (isDateTime) {\n return `${shortDatePattern} ${shortTimePattern}`;\n }\n return shortDatePattern;\n })();\n\n const formatDate = (date: Date | undefined | null | string): string | undefined | null => {\n if (date instanceof Date) {\n if (isDateTime) {\n //should handle the time zone conversion\n return context.formatting.formatTime(date, behavior);\n }\n return context.formatting.formatDateShort(date);\n }\n return date;\n };\n\n const {value, labels, theme, setValue, onNotifyOutputChanged} = useInputBasedControl<string | undefined, IDateTimeParameters, IDateTimeOutputs, Required<IDateTime>['translations']>('DateTime', props, {\n formatter: formatDate,\n defaultTranslations: getDefaultDateTimeTranslations(props.context.userSettings.dateFormattingInfo)\n });\n\n useEffect(() => {\n const onBlur = () => {\n onNotifyOutputChanged({\n value: dateExtractor(value!) as any\n });\n };\n const input = ref.current?.querySelector('input');\n input?.addEventListener('blur', onBlur);\n return () => {\n input?.removeEventListener('blur', onBlur);\n };\n }, [value]);\n\n useEffect(() => {\n if (boundValue.raw instanceof Date) {\n lastValidDateRef.current = boundValue.raw;\n }\n }, [boundValue.raw]);\n\n const getDate = (): Date | undefined => {\n if (boundValue.raw instanceof Date) {\n if (behavior === 3) {\n //the date in javascript gets automatically adjusted to local time zone\n //this will make it think that the date already came in local time, thus not adjusting the time\n const date = new Date(boundValue.raw.toISOString().replace('Z', ''));\n return date;\n }\n return boundValue.raw;\n }\n if(boundValue.error) {\n return lastValidDateRef.current;\n }\n return undefined;\n };\n\n const dateExtractor = (value: string | Date): Date | string => {\n if (value instanceof Date) {\n return value;\n }\n const dayjsDate = dayjs(value, formatting, true);\n if (!dayjsDate.isValid()) {\n const dayJsDateNoWhiteSpace = dayjs(value?.replaceAll(' ', ''), formatting.replaceAll(' ', ''));\n if(!dayJsDateNoWhiteSpace.isValid()) {\n return value;\n }\n else {\n return dayJsDateNoWhiteSpace.toDate();\n }\n }\n return dayjsDate.toDate();\n };\n\n const clearDate = () => {\n onNotifyOutputChanged({\n value: undefined\n });\n };\n\n const selectDate = (date?: Date, time?: string) => {\n //onSelectDate can trigger on initial click with empty date, do not continue in this case\n //for clearing dates, date.clear should be used\n if(!date && !time) {\n return;\n }\n let dayjsDate = dayjs(date ?? getDate());\n //date selected from calendar, keep the original time\n if (!time) {\n time = dayjs(getDate()).format(shortTimePattern);\n }\n const dayjsTime = dayjs(time, shortTimePattern, true);\n let invalidDateString;\n if(!dayjsTime.isValid()) {\n invalidDateString = `${dayjsDate.format(shortDatePattern)} ${time}`\n }\n dayjsDate = dayjsDate.hour(dayjsTime.hour());\n dayjsDate = dayjsDate.minute(dayjsTime.minute());\n onNotifyOutputChanged({\n value: dateExtractor(invalidDateString ?? dayjsDate.toDate()) as any\n });\n };\n return [\n isDateTime,\n theme,\n labels,\n {\n get: getDate,\n clear: clearDate,\n getFormatted: () => value,\n set: selectDate,\n setDateString: setValue\n },\n {\n shortDatePattern: shortDatePattern,\n shortTimePattern: shortTimePattern,\n fullDateTimePattern: `${shortDatePattern} ${shortTimePattern}`\n }\n ]\n};"],"names":[],"mappings":";;;;;;;AAUA,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAChC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;MAEL,WAAW,GAAG,CAAC,KAAgB,EAAE,GAAoC,KAgB9E;AAEA,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;AAC1C,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAC9B,IAAA,MAAM,Q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CAAA,CAAA,EAAI,gBAAgB,CAAE,CAAA;AACjE,SAAA;KACJ,CAAA;AACL;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext, useState, useEffect } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import deepEqual from 'fast-deep-equal/es6';
|
|
3
3
|
import { GridContext } from '../../GridContext.js';
|
|
4
4
|
|
|
5
5
|
const useGridController = (gridInstance) => {
|
|
@@ -9,7 +9,7 @@ const useGridController = (gridInstance) => {
|
|
|
9
9
|
useEffect(() => {
|
|
10
10
|
(async () => {
|
|
11
11
|
const newColumns = await grid.refreshColumns();
|
|
12
|
-
if (!
|
|
12
|
+
if (!deepEqual(newColumns, columns)) {
|
|
13
13
|
setColumns(newColumns);
|
|
14
14
|
}
|
|
15
15
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGridController.js","sources":["../../../../../src/components/Grid/core/controllers/useGridController.ts"],"sourcesContent":["import { useContext, useEffect, useState } from \"react\"\nimport equal from 'fast-deep-equal/es6';\nimport { Grid } from \"../model/Grid\";\nimport { IGridColumn } from \"../interfaces/IGridColumn\";\nimport { GridContext } from \"../../GridContext\";\n\ninterface IGridController {\n columns: IGridColumn[]\n}\n\nexport const useGridController = (gridInstance?: Grid): IGridController => {\n const grid = gridInstance ?? useContext(GridContext).gridInstance;\n const [columns, setColumns] = useState<IGridColumn[]>(grid.columns);\n\n\n //only change columns and records reference if there is a change\n useEffect(() => {\n (async () => {\n const newColumns = await grid.refreshColumns();\n if(!equal(newColumns, columns)) {\n setColumns(newColumns);\n }\n })();\n }, [grid.shouldRerender]);\n return {\n columns\n }\n}"],"names":[],"mappings":";;;;AAUa,MAAA,iBAAiB,GAAG,CAAC,YAAmB,KAAqB;IACtE,MAAM,IAAI,GAAG,YAAY,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC;AAClE,IAAA,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,OAAO,CAAC,CAAC;;IAIpE,SAAS,CAAC,MAAK;QACX,CAAC,YAAW;AACR,YAAA,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;AAC/C,YAAA,IAAG,
|
|
1
|
+
{"version":3,"file":"useGridController.js","sources":["../../../../../src/components/Grid/core/controllers/useGridController.ts"],"sourcesContent":["import { useContext, useEffect, useState } from \"react\"\nimport equal from 'fast-deep-equal/es6';\nimport { Grid } from \"../model/Grid\";\nimport { IGridColumn } from \"../interfaces/IGridColumn\";\nimport { GridContext } from \"../../GridContext\";\n\ninterface IGridController {\n columns: IGridColumn[]\n}\n\nexport const useGridController = (gridInstance?: Grid): IGridController => {\n const grid = gridInstance ?? useContext(GridContext).gridInstance;\n const [columns, setColumns] = useState<IGridColumn[]>(grid.columns);\n\n\n //only change columns and records reference if there is a change\n useEffect(() => {\n (async () => {\n const newColumns = await grid.refreshColumns();\n if(!equal(newColumns, columns)) {\n setColumns(newColumns);\n }\n })();\n }, [grid.shouldRerender]);\n return {\n columns\n }\n}"],"names":["equal"],"mappings":";;;;AAUa,MAAA,iBAAiB,GAAG,CAAC,YAAmB,KAAqB;IACtE,MAAM,IAAI,GAAG,YAAY,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC;AAClE,IAAA,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,OAAO,CAAC,CAAC;;IAIpE,SAAS,CAAC,MAAK;QACX,CAAC,YAAW;AACR,YAAA,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;AAC/C,YAAA,IAAG,CAACA,SAAK,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE;gBAC5B,UAAU,CAAC,UAAU,CAAC,CAAC;AAC1B,aAAA;SACJ,GAAG,CAAC;AACT,KAAC,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAC1B,OAAO;QACH,OAAO;KACV,CAAA;AACL;;;;"}
|
package/dist/hooks/useControl.js
CHANGED
|
@@ -3,8 +3,8 @@ import { merge } from 'merge-anything';
|
|
|
3
3
|
import { Liquid } from 'liquidjs';
|
|
4
4
|
import { useControlTheme } from './useControlTheme.js';
|
|
5
5
|
import { useControlSizing } from './useControlSizing.js';
|
|
6
|
+
import deepEqual from 'fast-deep-equal/es6';
|
|
6
7
|
|
|
7
|
-
const deepEqual = require('fast-deep-equal/react');
|
|
8
8
|
/**
|
|
9
9
|
* Provides automatic checking if the given outputs are different from the provided inputs. Use the provided method any time you want
|
|
10
10
|
* to notify the framework that you wish to write changes. The hook will notify the framework only if the provided output differs from the current inputs.
|
|
@@ -56,7 +56,6 @@ const useControl = (name, props, defaultTranslations) => {
|
|
|
56
56
|
let isDirty = false;
|
|
57
57
|
for (let [key, outputValue] of Object.entries(outputs)) {
|
|
58
58
|
let parameterValue = parametersRef.current[key]?.raw;
|
|
59
|
-
//@ts-ignore - types
|
|
60
59
|
if (!deepEqual(parameterValue, outputValue)) {
|
|
61
60
|
if (outputValue === null) {
|
|
62
61
|
outputValue = undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useControl.js","sources":["../../src/hooks/useControl.ts"],"sourcesContent":["import { useEffect, useMemo, useRef } from \"react\";\nimport { IControl, IOutputs, IParameters } from \"../interfaces\";\nimport { merge } from 'merge-anything';\nimport { Liquid } from \"liquidjs\";\nimport { useControlTheme } from \"./useControlTheme\";\nimport { ITheme } from \"../interfaces/theme\";\nimport { useControlSizing } from \"./useControlSizing\";\
|
|
1
|
+
{"version":3,"file":"useControl.js","sources":["../../src/hooks/useControl.ts"],"sourcesContent":["import { useEffect, useMemo, useRef } from \"react\";\nimport { IControl, IOutputs, IParameters } from \"../interfaces\";\nimport { merge } from 'merge-anything';\nimport { Liquid } from \"liquidjs\";\nimport { useControlTheme } from \"./useControlTheme\";\nimport { ITheme } from \"../interfaces/theme\";\nimport { useControlSizing } from \"./useControlSizing\";\nimport deepEqual from 'fast-deep-equal/es6';\n\nexport type ITranslation<T> = {\n [Property in keyof Required<T>]: (variables?: any) => string\n};\n\nexport interface IDefaultTranslations {\n [LCID: number]: string | string[];\n [key: string]: any;\n}\n\n\nexport interface IControlController<TTranslations, TOutputs> {\n labels: Required<ITranslation<TTranslations>>,\n sizing: {\n width?: number,\n height?: number\n },\n theme: ITheme;\n onNotifyOutputChanged: (outputs: TOutputs) => void,\n}\n/**\n * Provides automatic checking if the given outputs are different from the provided inputs. Use the provided method any time you want\n * to notify the framework that you wish to write changes. The hook will notify the framework only if the provided output differs from the current inputs.\n */\nexport const useControl = <TParameters extends IParameters, TOutputs extends IOutputs, TTranslations>(name: string, props: IControl<TParameters, TOutputs, TTranslations, any>, defaultTranslations?: IDefaultTranslations): IControlController<TTranslations, TOutputs> => {\n const parametersRef = useRef<TParameters>(props.parameters);\n const sizing = useControlSizing(props.context.mode);\n const context = props.context;\n const liquid = useMemo(() => new Liquid(), []);\n const labels = useMemo(() => {\n const mergedTranslations = merge(defaultTranslations ?? {}, props.translations ?? {}) as TTranslations;\n return new Proxy(mergedTranslations as any, {\n get(target, key) {\n return (variables: any) => getLabel(key as string, mergedTranslations, variables)\n }\n }) as any;\n }, []);\n\n useEffect(() => {\n parametersRef.current = props.parameters;\n }, [props.parameters]);\n\n const getLabel = (key: string, translations: TTranslations, variables?: any): string | string[] => {\n const strigify = (value: string | string[]) => {\n if (typeof value === 'string') {\n return value;\n }\n return JSON.stringify(value);\n };\n //@ts-ignore\n const translation = translations[key];\n if (!translation) {\n console.error(`Translation for the ${key} label of the ${name} control has not been defined!`);\n return key;\n }\n if (typeof translation === 'string' || Array.isArray(translation)) {\n return strigify(translation);\n }\n let label = translation[props.context.userSettings.languageId];\n if (!label) {\n console.info(`Translation for the ${key} label of the ${name} control has not been found. Using default Czech label instead.`);\n label = translation[1029];\n }\n if (!label) {\n console.error(`Translation for the ${key} label of the ${name} control does not exists neither for Czech language and current LCID.`);\n label = key;\n }\n\n return liquid.parseAndRenderSync(strigify(label), variables);\n };\n\n const onNotifyOutputChanged = (outputs: TOutputs) => {\n let isDirty = false;\n for (let [key, outputValue] of Object.entries(outputs)) {\n let parameterValue = parametersRef.current[key]?.raw;\n if (!deepEqual(parameterValue, outputValue)) {\n if (outputValue === null) {\n outputValue = undefined;\n //@ts-ignore\n outputs[key] = undefined;\n }\n if (outputValue === \"\") {\n outputValue = undefined\n //@ts-ignore\n outputs[key] = undefined;\n }\n if (parameterValue === null) {\n parameterValue = undefined;\n }\n if (parameterValue === outputValue) {\n continue\n }\n isDirty = true;\n break;\n }\n }\n if (!isDirty) {\n return;\n }\n //console.log(`Change detected, triggering notifyOutputChanged on control ${name}.`);\n props.onNotifyOutputChanged?.(outputs);\n };\n return {\n labels,\n sizing,\n theme: useControlTheme(context.fluentDesignLanguage),\n onNotifyOutputChanged\n }\n};\n"],"names":[],"mappings":";;;;;;;AA4BA;;;AAGG;AACU,MAAA,UAAU,GAAG,CAA4E,IAAY,EAAE,KAA0D,EAAE,mBAA0C,KAAiD;IACvQ,MAAM,aAAa,GAAG,MAAM,CAAc,KAAK,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACpD,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAC9B,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;AAC/C,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAK;AACxB,QAAA,MAAM,kBAAkB,GAAG,KAAK,CAAC,mBAAmB,IAAI,EAAE,EAAE,KAAK,CAAC,YAAY,IAAI,EAAE,CAAkB,CAAC;AACvG,QAAA,OAAO,IAAI,KAAK,CAAC,kBAAyB,EAAE;YACxC,GAAG,CAAC,MAAM,EAAE,GAAG,EAAA;AACX,gBAAA,OAA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