@talxis/base-controls 1.2506.7 → 1.2507.1
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.
|
@@ -48,7 +48,7 @@ const TwoOptions = (props) => {
|
|
|
48
48
|
container: {
|
|
49
49
|
alignItems: 'center'
|
|
50
50
|
}
|
|
51
|
-
}, theme: theme, checked: boundValue.raw, componentRef: componentRef, disabled: context.mode.isControlDisabled, inlineLabel: true, onText: options.find(option => option.Value === 1)?.Label || 'Yes', offText: options.find(option => option.Value === 0)?.Label || 'No', onChange: (e, value) => handleChange(value) })) }));
|
|
51
|
+
}, theme: theme, checked: !!boundValue.raw, componentRef: componentRef, disabled: context.mode.isControlDisabled, inlineLabel: true, onText: options.find(option => option.Value === 1)?.Label || 'Yes', offText: options.find(option => option.Value === 0)?.Label || 'No', onChange: (e, value) => handleChange(value) })) }));
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
export { TwoOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwoOptions.js","sources":["../../../src/components/TwoOptions/TwoOptions.tsx"],"sourcesContent":["import { ThemeProvider, Toggle } from '@fluentui/react';\nimport { useControl } from '../../hooks';\nimport { ITwoOptions } from './interfaces';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { OptionSet } from '../OptionSet';\n\nexport const TwoOptions = (props: ITwoOptions) => {\n const parameters = props.parameters;\n const boundValue = parameters.value;\n const options = boundValue.attributes.Options;\n const { sizing, onNotifyOutputChanged, theme } = useControl('TwoOptions', props);\n const context = props.context;\n const componentRef = useRef<any>(null);\n\n useEffect(() => {\n if (parameters.AutoFocus?.raw === true) {\n componentRef.current?.focus();\n }\n }, []);\n\n const isColorFeatureEnabled = () => {\n if (props.parameters.EnableOptionSetColors?.raw && options.find(x => x.Color)) {\n return true;\n }\n return false;\n }\n\n const handleChange = (value: boolean | undefined): void => {\n onNotifyOutputChanged({\n value: value\n });\n };\n\n return (\n <ThemeProvider theme={theme} applyTo='none'>\n {isColorFeatureEnabled() ? (\n <OptionSet\n context={props.context}\n parameters={{\n ...parameters as any,\n value: {\n raw: boundValue.raw !== null ? boundValue.raw ? 1 : 0 : boundValue.raw,\n //@ts-ignore - typings\n attributes: boundValue.attributes\n },\n EnableOptionSetColors: {\n raw: true\n }\n }}\n onNotifyOutputChanged={(outputs) => {\n handleChange(outputs.value == 1 ? true : outputs.value == 0 ? false : undefined);\n }}\n />\n ) : (\n <Toggle\n styles={{\n root: {\n height: sizing.height,\n width: sizing.width,\n marginBottom: 0,\n },\n container: {\n alignItems: 'center'\n }\n }}\n theme={theme}\n checked={boundValue.raw}\n componentRef={componentRef}\n disabled={context.mode.isControlDisabled}\n inlineLabel\n onText={options.find(option => option.Value === 1)?.Label || 'Yes'}\n offText={options.find(option => option.Value === 0)?.Label || 'No'}\n onChange={(e, value) => handleChange(value)}\n />)}\n </ThemeProvider>\n )\n};"],"names":["_jsx"],"mappings":";;;;;;AAMa,MAAA,UAAU,GAAG,CAAC,KAAkB,KAAI;AAC7C,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;AACpC,IAAA,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC;AACpC,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC;AAC9C,IAAA,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AACjF,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAC9B,IAAA,MAAM,YAAY,GAAG,MAAM,CAAM,IAAI,CAAC,CAAC;IAEvC,SAAS,CAAC,MAAK;AACX,QAAA,IAAI,UAAU,CAAC,SAAS,EAAE,GAAG,KAAK,IAAI,EAAE;AACpC,YAAA,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjC,SAAA;KACJ,EAAE,EAAE,CAAC,CAAC;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,CAAC,KAAK;AACnB,oBAAA,YAAY,EAAE,CAAC;AAClB,iBAAA;AACD,gBAAA,SAAS,EAAE;AACP,oBAAA,UAAU,EAAE,QAAQ;AACvB,iBAAA;AACJ,aAAA,EACD,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,UAAU,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"TwoOptions.js","sources":["../../../src/components/TwoOptions/TwoOptions.tsx"],"sourcesContent":["import { ThemeProvider, Toggle } from '@fluentui/react';\nimport { useControl } from '../../hooks';\nimport { ITwoOptions } from './interfaces';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { OptionSet } from '../OptionSet';\n\nexport const TwoOptions = (props: ITwoOptions) => {\n const parameters = props.parameters;\n const boundValue = parameters.value;\n const options = boundValue.attributes.Options;\n const { sizing, onNotifyOutputChanged, theme } = useControl('TwoOptions', props);\n const context = props.context;\n const componentRef = useRef<any>(null);\n\n useEffect(() => {\n if (parameters.AutoFocus?.raw === true) {\n componentRef.current?.focus();\n }\n }, []);\n\n const isColorFeatureEnabled = () => {\n if (props.parameters.EnableOptionSetColors?.raw && options.find(x => x.Color)) {\n return true;\n }\n return false;\n }\n\n const handleChange = (value: boolean | undefined): void => {\n onNotifyOutputChanged({\n value: value\n });\n };\n\n return (\n <ThemeProvider theme={theme} applyTo='none'>\n {isColorFeatureEnabled() ? (\n <OptionSet\n context={props.context}\n parameters={{\n ...parameters as any,\n value: {\n raw: boundValue.raw !== null ? boundValue.raw ? 1 : 0 : boundValue.raw,\n //@ts-ignore - typings\n attributes: boundValue.attributes\n },\n EnableOptionSetColors: {\n raw: true\n }\n }}\n onNotifyOutputChanged={(outputs) => {\n handleChange(outputs.value == 1 ? true : outputs.value == 0 ? false : undefined);\n }}\n />\n ) : (\n <Toggle\n styles={{\n root: {\n height: sizing.height,\n width: sizing.width,\n marginBottom: 0,\n },\n container: {\n alignItems: 'center'\n }\n }}\n theme={theme}\n checked={!!boundValue.raw}\n componentRef={componentRef}\n disabled={context.mode.isControlDisabled}\n inlineLabel\n onText={options.find(option => option.Value === 1)?.Label || 'Yes'}\n offText={options.find(option => option.Value === 0)?.Label || 'No'}\n onChange={(e, value) => handleChange(value)}\n />)}\n </ThemeProvider>\n )\n};"],"names":["_jsx"],"mappings":";;;;;;AAMa,MAAA,UAAU,GAAG,CAAC,KAAkB,KAAI;AAC7C,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;AACpC,IAAA,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC;AACpC,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC;AAC9C,IAAA,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AACjF,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAC9B,IAAA,MAAM,YAAY,GAAG,MAAM,CAAM,IAAI,CAAC,CAAC;IAEvC,SAAS,CAAC,MAAK;AACX,QAAA,IAAI,UAAU,CAAC,SAAS,EAAE,GAAG,KAAK,IAAI,EAAE;AACpC,YAAA,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjC,SAAA;KACJ,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,qBAAqB,GAAG,MAAK;QAC/B,IAAI,KAAK,CAAC,UAAU,CAAC,qBAAqB,EAAE,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE;AAC3E,YAAA,OAAO,IAAI,CAAC;AACf,SAAA;AACD,QAAA,OAAO,KAAK,CAAC;AACjB,KAAC,CAAA;AAED,IAAA,MAAM,YAAY,GAAG,CAAC,KAA0B,KAAU;AACtD,QAAA,qBAAqB,CAAC;AAClB,YAAA,KAAK,EAAE,KAAK;AACf,SAAA,CAAC,CAAC;AACP,KAAC,CAAC;AAEF,IAAA,QACIA,GAAA,CAA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