@fluentui/react-compose
Advanced tools
Comparing version 0.11.1 to 0.11.2
@@ -5,2 +5,17 @@ { | ||
{ | ||
"date": "Tue, 16 Jun 2020 12:39:01 GMT", | ||
"tag": "@fluentui/react-compose_v0.11.2", | ||
"version": "0.11.2", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "Pass forwarded ref as param in state option", | ||
"author": "xgao@microsoft.com", | ||
"commit": "2377f7afd141ff0203470e82b705ab29ed3cb044", | ||
"package": "@fluentui/react-compose" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Fri, 12 Jun 2020 18:29:07 GMT", | ||
@@ -7,0 +22,0 @@ "tag": "@fluentui/react-compose_v0.11.0", |
# Change Log - @fluentui/react-compose | ||
This log was last generated on Fri, 12 Jun 2020 18:29:07 GMT and should not be manually modified. | ||
This log was last generated on Tue, 16 Jun 2020 12:39:01 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## [0.11.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-compose_v0.11.2) | ||
Tue, 16 Jun 2020 12:39:01 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-compose_v0.11.0..@fluentui/react-compose_v0.11.2) | ||
### Patches | ||
- Pass forwarded ref as param in state option ([PR #13570](https://github.com/microsoft/fluentui/pull/13570) by xgao@microsoft.com) | ||
## [0.11.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-compose_v0.11.0) | ||
@@ -8,0 +17,0 @@ |
@@ -699,6 +699,24 @@ { | ||
"kind": "Content", | ||
"text": "<TParentProps & TInputProps>;\n state?: (props: TState, options: " | ||
"text": "<TParentProps & TInputProps>;\n state?: (props: TState, ref: " | ||
}, | ||
{ | ||
"kind": "Reference", | ||
"text": "React.Ref", | ||
"canonicalReference": "@types/react!~React.Ref:type" | ||
}, | ||
{ | ||
"kind": "Content", | ||
"text": "<" | ||
}, | ||
{ | ||
"kind": "Reference", | ||
"text": "HTMLElement", | ||
"canonicalReference": "!HTMLElement:interface" | ||
}, | ||
{ | ||
"kind": "Content", | ||
"text": ">, options: " | ||
}, | ||
{ | ||
"kind": "Reference", | ||
"text": "ComposePreparedOptions", | ||
@@ -777,3 +795,3 @@ "canonicalReference": "@fluentui/react-compose!ComposePreparedOptions:type" | ||
"startIndex": 11, | ||
"endIndex": 30 | ||
"endIndex": 34 | ||
} | ||
@@ -879,6 +897,24 @@ }, | ||
"kind": "Content", | ||
"text": "<string, object>)[];\n state: (props: TParentState, options: " | ||
"text": "<string, object>)[];\n state: (props: TParentState, ref: " | ||
}, | ||
{ | ||
"kind": "Reference", | ||
"text": "React.Ref", | ||
"canonicalReference": "@types/react!~React.Ref:type" | ||
}, | ||
{ | ||
"kind": "Content", | ||
"text": "<" | ||
}, | ||
{ | ||
"kind": "Reference", | ||
"text": "HTMLElement", | ||
"canonicalReference": "!HTMLElement:interface" | ||
}, | ||
{ | ||
"kind": "Content", | ||
"text": ">, options: " | ||
}, | ||
{ | ||
"kind": "Reference", | ||
"text": "ComposePreparedOptions", | ||
@@ -953,3 +989,3 @@ "canonicalReference": "@fluentui/react-compose!ComposePreparedOptions:type" | ||
"startIndex": 7, | ||
"endIndex": 28 | ||
"endIndex": 32 | ||
} | ||
@@ -956,0 +992,0 @@ }, |
@@ -42,3 +42,3 @@ import * as React from 'react'; | ||
shorthandConfig?: ShorthandConfig<TParentProps & TInputProps>; | ||
state?: (props: TState, options: ComposePreparedOptions) => any; | ||
state?: (props: TState, ref: React.Ref<HTMLElement>, options: ComposePreparedOptions) => any; | ||
}; | ||
@@ -62,3 +62,3 @@ | ||
slotProps: ((props: TProps) => Record<string, object>)[]; | ||
state: (props: TParentState, options: ComposePreparedOptions) => TInputState; | ||
state: (props: TParentState, ref: React.Ref<HTMLElement>, options: ComposePreparedOptions) => TInputState; | ||
resolveSlotProps: <TResolvedProps>(props: TResolvedProps) => Record<string, object>; | ||
@@ -65,0 +65,0 @@ shorthandConfig: ShorthandConfig<TProps>; |
@@ -357,3 +357,3 @@ var FluentCompose = | ||
var Component = react__WEBPACK_IMPORTED_MODULE_1__["forwardRef"](function (props, ref) { | ||
return composeOptions.render(props, ref, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, composeOptions), { state: composeOptions.state(props, composeOptions), slots: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, composeOptions.slots), { __self: Component }) })); | ||
return composeOptions.render(props, ref, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, composeOptions), { state: composeOptions.state(props, ref, composeOptions), slots: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, composeOptions.slots), { __self: Component }) })); | ||
}); | ||
@@ -583,7 +583,7 @@ Component.displayName = composeOptions.displayName; | ||
var inputClasses = Array.isArray(inputOptions.classes) ? inputOptions.classes : [inputOptions.classes]; | ||
var state = function (props, options) { | ||
var state = function (props, ref, options) { | ||
if (inputOptions.state) { | ||
return inputOptions.state(parentOptions.state(props, options), options); | ||
return inputOptions.state(parentOptions.state(props, ref, options), ref, options); | ||
} | ||
return parentOptions.state(props, options); | ||
return parentOptions.state(props, ref, options); | ||
}; | ||
@@ -590,0 +590,0 @@ return { |
@@ -1,2 +0,2 @@ | ||
var FluentCompose=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=1)}([function(e,r){e.exports=React},function(e,r,t){"use strict";t.r(r),t.d(r,"compose",(function(){return i})),t.d(r,"createClassResolver",(function(){return u})),t.d(r,"mergeProps",(function(){return v}));var n=function(){return(n=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e}).apply(this,arguments)};function o(){for(var e=0,r=0,t=arguments.length;r<t;r++)e+=arguments[r].length;var n=Array(e),o=0;for(r=0;r<t;r++)for(var s=arguments[r],a=0,l=s.length;a<l;a++,o++)n[o]=s[a];return n}var s=t(0);function a(e,r){return e.overrideStyles?[e.displayName].filter(Boolean):e.displayName?r.displayNames.concat(e.displayName):r.displayNames}var l={className:"",classes:[],displayName:"",displayNames:[],mapPropsToStylesPropsChain:[],render:function(){return null},handledProps:[],overrideStyles:!1,slots:{__self:function(){return null}},slotProps:[],state:function(e){return e},resolveSlotProps:function(){return{}},shorthandConfig:{}};var i=function(e,r){void 0===r&&(r={});var t=function(e,r,t){void 0===t&&(t=l);var s=r.slotProps?o(t.slotProps,[r.slotProps]):t.slotProps,i=Array.isArray(r.classes)?r.classes:[r.classes];return{className:r.className||t.className,classes:o(t.classes,i),displayName:r.displayName||t.displayName,displayNames:a(r,t),mapPropsToStylesPropsChain:r.mapPropsToStylesProps?o(t.mapPropsToStylesPropsChain,[r.mapPropsToStylesProps]):t.mapPropsToStylesPropsChain,render:"function"==typeof e?e:t.render,handledProps:o(t.handledProps,r.handledProps||[]),overrideStyles:r.overrideStyles||!1,slots:n(n({},t.slots),r.slots),slotProps:s,state:function(e,n){return r.state?r.state(t.state(e,n),n):t.state(e,n)},resolveSlotProps:function(e){return s.reduce((function(r,t){var s=n({},t(e)),a=o(Object.keys(r),Object.keys(s)),l={};return a.forEach((function(e){l[e]||(l[e]=n(n({},r[e]),s[e]))})),l}),{})},shorthandConfig:n(n({},t.shorthandConfig),r.shorthandConfig)}}(e,r,function(e){return!!e.fluentComposeConfig}(e)?e.fluentComposeConfig:void 0),i=s.forwardRef((function(e,r){return t.render(e,r,n(n({},t),{state:t.state(e,t),slots:n(n({},t.slots),{__self:i})}))}));return i.displayName=t.displayName,e.defaultProps&&(i.defaultProps=e.defaultProps),i.fluentComposeConfig=t,i};function f(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];for(var t="",n=0,o=e;n<o.length;n++){var s=o[n];s&&(t=(t?t+" ":"")+s)}return t}var u=function(e){var r=function(e){var r={slots:{},modifiers:{},enums:{}},t=r.slots,n=r.modifiers,o=r.enums;return Object.keys(e).forEach((function(r){var s=e[r];if(s){var a=r.split("_");switch(a.length){case 2:n[a[1]]=s;break;case 3:var l=a[1],i=a[2];(o[l]=o[l]||{})[i]=s;break;default:t[r]=s}}})),r}(e),t=r.slots,n=r.modifiers,o=r.enums;return function(e){for(var r={},s="",a=0,l=Object.keys(n);a<l.length;a++){var i=l[a];e[i]&&(s=f(s,n[i]))}for(var u="",c=0,p=Object.keys(o);c<p.length;c++){var d=p[c],y=o[d];y[e[d]]&&(u=f(u,y[e[d]]))}for(var v=0,m=Object.keys(t);v<m.length;v++){var h=m[v];r[h]=f(t[h],s,u)}return r}};function c(e,r,t){if(t){var n=e[r]=e[r]||{};n.className=f(n.className,t)}}var p={iframe:"src",img:"src",input:"type"},d=function(){return null};function y(e,r){var t=e.state,o=e.slots,a=e.slotProps;return r.slotProps.forEach((function(e){var r=e(t);Object.keys(r).forEach((function(e){a[e]=n(n({},a[e]),r[e])}))})),function(e,r,t){t&&(e[r]||(e[r]={}),e[r]=n(n({},e[r]),t))}(a,"root",function(e,r){for(var t={},n=Object.keys(r.slots),o=0,s=Object.keys(e);o<s.length;o++){var a=s[o];"className"!==a&&"as"!==a&&-1===r.handledProps.indexOf(a)&&-1===n.indexOf(a)&&(t[a]=e[a])}return t}(t,r)),Object.keys(o).forEach((function(e){var r,l=o[e],i=t[e];if(l&&null!=i){var f=typeof i;if("string"===f||"number"===f||"boolean"===f||s.isValidElement(i))(r={})[l&&l.shorthandConfig&&l.shorthandConfig.mappedProp||p[l]||"children"]=i,i=r;if("function"==typeof i.children){i.children;var u=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}(i,["children"]);i.children=i.children(l,u),o[e]=s.Fragment}a[e]=n(n({},a[e]),i)}o[e]&&null!==i||(o[e]=d)})),e}function v(e,r){var t={state:e,slots:n(n({},r.slots),{root:e.as||r.slots.root||"div"}),slotProps:{}};return y(t,r),function(e,r){for(var t=e.state,n=e.slots,o=e.slotProps,s=0,a=r;s<a.length;s++){var l=a[s],i="function"==typeof l?l(t,n):l;if(i)for(var f=0,u=Object.keys(i);f<u.length;f++){var p=u[f];i[p]&&n[p]&&c(o,p,i[p])}}c(o,"root",t.className)}(t,r.classes),t}}]); | ||
var FluentCompose=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=1)}([function(e,r){e.exports=React},function(e,r,t){"use strict";t.r(r),t.d(r,"compose",(function(){return i})),t.d(r,"createClassResolver",(function(){return u})),t.d(r,"mergeProps",(function(){return v}));var n=function(){return(n=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e}).apply(this,arguments)};function o(){for(var e=0,r=0,t=arguments.length;r<t;r++)e+=arguments[r].length;var n=Array(e),o=0;for(r=0;r<t;r++)for(var s=arguments[r],a=0,l=s.length;a<l;a++,o++)n[o]=s[a];return n}var s=t(0);function a(e,r){return e.overrideStyles?[e.displayName].filter(Boolean):e.displayName?r.displayNames.concat(e.displayName):r.displayNames}var l={className:"",classes:[],displayName:"",displayNames:[],mapPropsToStylesPropsChain:[],render:function(){return null},handledProps:[],overrideStyles:!1,slots:{__self:function(){return null}},slotProps:[],state:function(e){return e},resolveSlotProps:function(){return{}},shorthandConfig:{}};var i=function(e,r){void 0===r&&(r={});var t=function(e,r,t){void 0===t&&(t=l);var s=r.slotProps?o(t.slotProps,[r.slotProps]):t.slotProps,i=Array.isArray(r.classes)?r.classes:[r.classes];return{className:r.className||t.className,classes:o(t.classes,i),displayName:r.displayName||t.displayName,displayNames:a(r,t),mapPropsToStylesPropsChain:r.mapPropsToStylesProps?o(t.mapPropsToStylesPropsChain,[r.mapPropsToStylesProps]):t.mapPropsToStylesPropsChain,render:"function"==typeof e?e:t.render,handledProps:o(t.handledProps,r.handledProps||[]),overrideStyles:r.overrideStyles||!1,slots:n(n({},t.slots),r.slots),slotProps:s,state:function(e,n,o){return r.state?r.state(t.state(e,n,o),n,o):t.state(e,n,o)},resolveSlotProps:function(e){return s.reduce((function(r,t){var s=n({},t(e)),a=o(Object.keys(r),Object.keys(s)),l={};return a.forEach((function(e){l[e]||(l[e]=n(n({},r[e]),s[e]))})),l}),{})},shorthandConfig:n(n({},t.shorthandConfig),r.shorthandConfig)}}(e,r,function(e){return!!e.fluentComposeConfig}(e)?e.fluentComposeConfig:void 0),i=s.forwardRef((function(e,r){return t.render(e,r,n(n({},t),{state:t.state(e,r,t),slots:n(n({},t.slots),{__self:i})}))}));return i.displayName=t.displayName,e.defaultProps&&(i.defaultProps=e.defaultProps),i.fluentComposeConfig=t,i};function f(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];for(var t="",n=0,o=e;n<o.length;n++){var s=o[n];s&&(t=(t?t+" ":"")+s)}return t}var u=function(e){var r=function(e){var r={slots:{},modifiers:{},enums:{}},t=r.slots,n=r.modifiers,o=r.enums;return Object.keys(e).forEach((function(r){var s=e[r];if(s){var a=r.split("_");switch(a.length){case 2:n[a[1]]=s;break;case 3:var l=a[1],i=a[2];(o[l]=o[l]||{})[i]=s;break;default:t[r]=s}}})),r}(e),t=r.slots,n=r.modifiers,o=r.enums;return function(e){for(var r={},s="",a=0,l=Object.keys(n);a<l.length;a++){var i=l[a];e[i]&&(s=f(s,n[i]))}for(var u="",c=0,p=Object.keys(o);c<p.length;c++){var d=p[c],y=o[d];y[e[d]]&&(u=f(u,y[e[d]]))}for(var v=0,m=Object.keys(t);v<m.length;v++){var h=m[v];r[h]=f(t[h],s,u)}return r}};function c(e,r,t){if(t){var n=e[r]=e[r]||{};n.className=f(n.className,t)}}var p={iframe:"src",img:"src",input:"type"},d=function(){return null};function y(e,r){var t=e.state,o=e.slots,a=e.slotProps;return r.slotProps.forEach((function(e){var r=e(t);Object.keys(r).forEach((function(e){a[e]=n(n({},a[e]),r[e])}))})),function(e,r,t){t&&(e[r]||(e[r]={}),e[r]=n(n({},e[r]),t))}(a,"root",function(e,r){for(var t={},n=Object.keys(r.slots),o=0,s=Object.keys(e);o<s.length;o++){var a=s[o];"className"!==a&&"as"!==a&&-1===r.handledProps.indexOf(a)&&-1===n.indexOf(a)&&(t[a]=e[a])}return t}(t,r)),Object.keys(o).forEach((function(e){var r,l=o[e],i=t[e];if(l&&null!=i){var f=typeof i;if("string"===f||"number"===f||"boolean"===f||s.isValidElement(i))(r={})[l&&l.shorthandConfig&&l.shorthandConfig.mappedProp||p[l]||"children"]=i,i=r;if("function"==typeof i.children){i.children;var u=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}(i,["children"]);i.children=i.children(l,u),o[e]=s.Fragment}a[e]=n(n({},a[e]),i)}o[e]&&null!==i||(o[e]=d)})),e}function v(e,r){var t={state:e,slots:n(n({},r.slots),{root:e.as||r.slots.root||"div"}),slotProps:{}};return y(t,r),function(e,r){for(var t=e.state,n=e.slots,o=e.slotProps,s=0,a=r;s<a.length;s++){var l=a[s],i="function"==typeof l?l(t,n):l;if(i)for(var f=0,u=Object.keys(i);f<u.length;f++){var p=u[f];i[p]&&n[p]&&c(o,p,i[p])}}c(o,"root",t.className)}(t,r.classes),t}}]); | ||
//# sourceMappingURL=react-compose.min.js.map |
@@ -52,3 +52,3 @@ ## API Report File for "@fluentui/react-compose" | ||
shorthandConfig?: ShorthandConfig<TParentProps & TInputProps>; | ||
state?: (props: TState, options: ComposePreparedOptions) => any; | ||
state?: (props: TState, ref: React.Ref<HTMLElement>, options: ComposePreparedOptions) => any; | ||
}; | ||
@@ -70,3 +70,3 @@ | ||
slotProps: ((props: TProps) => Record<string, object>)[]; | ||
state: (props: TParentState, options: ComposePreparedOptions) => TInputState; | ||
state: (props: TParentState, ref: React.Ref<HTMLElement>, options: ComposePreparedOptions) => TInputState; | ||
resolveSlotProps: <TResolvedProps>(props: TResolvedProps) => Record<string, object>; | ||
@@ -73,0 +73,0 @@ shorthandConfig: ShorthandConfig<TProps>; |
@@ -8,3 +8,3 @@ define(["require", "exports", "tslib", "react", "./wasComposedPreviously", "./mergeComposeOptions"], function (require, exports, tslib_1, React, wasComposedPreviously_1, mergeComposeOptions_1) { | ||
var Component = React.forwardRef(function (props, ref) { | ||
return composeOptions.render(props, ref, tslib_1.__assign(tslib_1.__assign({}, composeOptions), { state: composeOptions.state(props, composeOptions), slots: tslib_1.__assign(tslib_1.__assign({}, composeOptions.slots), { __self: Component }) })); | ||
return composeOptions.render(props, ref, tslib_1.__assign(tslib_1.__assign({}, composeOptions), { state: composeOptions.state(props, ref, composeOptions), slots: tslib_1.__assign(tslib_1.__assign({}, composeOptions.slots), { __self: Component }) })); | ||
}); | ||
@@ -11,0 +11,0 @@ Component.displayName = composeOptions.displayName; |
@@ -22,7 +22,7 @@ define(["require", "exports", "tslib", "./computeDisplayNames", "./defaultComposeOptions"], function (require, exports, tslib_1, computeDisplayNames_1, defaultComposeOptions_1) { | ||
var inputClasses = Array.isArray(inputOptions.classes) ? inputOptions.classes : [inputOptions.classes]; | ||
var state = function (props, options) { | ||
var state = function (props, ref, options) { | ||
if (inputOptions.state) { | ||
return inputOptions.state(parentOptions.state(props, options), options); | ||
return inputOptions.state(parentOptions.state(props, ref, options), ref, options); | ||
} | ||
return parentOptions.state(props, options); | ||
return parentOptions.state(props, ref, options); | ||
}; | ||
@@ -29,0 +29,0 @@ return { |
@@ -42,3 +42,3 @@ import * as React from 'react'; | ||
shorthandConfig?: ShorthandConfig<TParentProps & TInputProps>; | ||
state?: (props: TState, options: ComposePreparedOptions) => any; | ||
state?: (props: TState, ref: React.Ref<HTMLElement>, options: ComposePreparedOptions) => any; | ||
}; | ||
@@ -78,5 +78,5 @@ export declare type MergePropsResult<TState extends GenericDictionary> = { | ||
slotProps: ((props: TProps) => Record<string, object>)[]; | ||
state: (props: TParentState, options: ComposePreparedOptions) => TInputState; | ||
state: (props: TParentState, ref: React.Ref<HTMLElement>, options: ComposePreparedOptions) => TInputState; | ||
resolveSlotProps: <TResolvedProps>(props: TResolvedProps) => Record<string, object>; | ||
shorthandConfig: ShorthandConfig<TProps>; | ||
}; |
define(["require", "exports", "@uifabric/set-version"], function (require, exports, set_version_1) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
set_version_1.setVersion('@fluentui/react-compose', '0.11.1'); | ||
set_version_1.setVersion('@fluentui/react-compose', '0.11.2'); | ||
}); | ||
//# sourceMappingURL=version.js.map |
@@ -11,3 +11,3 @@ "use strict"; | ||
var Component = React.forwardRef(function (props, ref) { | ||
return composeOptions.render(props, ref, tslib_1.__assign(tslib_1.__assign({}, composeOptions), { state: composeOptions.state(props, composeOptions), slots: tslib_1.__assign(tslib_1.__assign({}, composeOptions.slots), { __self: Component }) })); | ||
return composeOptions.render(props, ref, tslib_1.__assign(tslib_1.__assign({}, composeOptions), { state: composeOptions.state(props, ref, composeOptions), slots: tslib_1.__assign(tslib_1.__assign({}, composeOptions.slots), { __self: Component }) })); | ||
}); | ||
@@ -14,0 +14,0 @@ Component.displayName = composeOptions.displayName; |
@@ -24,7 +24,7 @@ "use strict"; | ||
var inputClasses = Array.isArray(inputOptions.classes) ? inputOptions.classes : [inputOptions.classes]; | ||
var state = function (props, options) { | ||
var state = function (props, ref, options) { | ||
if (inputOptions.state) { | ||
return inputOptions.state(parentOptions.state(props, options), options); | ||
return inputOptions.state(parentOptions.state(props, ref, options), ref, options); | ||
} | ||
return parentOptions.state(props, options); | ||
return parentOptions.state(props, ref, options); | ||
}; | ||
@@ -31,0 +31,0 @@ return { |
@@ -42,3 +42,3 @@ import * as React from 'react'; | ||
shorthandConfig?: ShorthandConfig<TParentProps & TInputProps>; | ||
state?: (props: TState, options: ComposePreparedOptions) => any; | ||
state?: (props: TState, ref: React.Ref<HTMLElement>, options: ComposePreparedOptions) => any; | ||
}; | ||
@@ -78,5 +78,5 @@ export declare type MergePropsResult<TState extends GenericDictionary> = { | ||
slotProps: ((props: TProps) => Record<string, object>)[]; | ||
state: (props: TParentState, options: ComposePreparedOptions) => TInputState; | ||
state: (props: TParentState, ref: React.Ref<HTMLElement>, options: ComposePreparedOptions) => TInputState; | ||
resolveSlotProps: <TResolvedProps>(props: TResolvedProps) => Record<string, object>; | ||
shorthandConfig: ShorthandConfig<TProps>; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// @fluentui/react-compose@0.11.1 | ||
// @fluentui/react-compose@0.11.2 | ||
// Do not modify this file, the file is generated as part of publish. The checked in version is a placeholder only. | ||
var set_version_1 = require("@uifabric/set-version"); | ||
set_version_1.setVersion('@fluentui/react-compose', '0.11.1'); | ||
set_version_1.setVersion('@fluentui/react-compose', '0.11.2'); | ||
//# sourceMappingURL=version.js.map |
@@ -9,3 +9,3 @@ import { __assign } from "tslib"; | ||
var Component = React.forwardRef(function (props, ref) { | ||
return composeOptions.render(props, ref, __assign(__assign({}, composeOptions), { state: composeOptions.state(props, composeOptions), slots: __assign(__assign({}, composeOptions.slots), { __self: Component }) })); | ||
return composeOptions.render(props, ref, __assign(__assign({}, composeOptions), { state: composeOptions.state(props, ref, composeOptions), slots: __assign(__assign({}, composeOptions.slots), { __self: Component }) })); | ||
}); | ||
@@ -12,0 +12,0 @@ Component.displayName = composeOptions.displayName; |
@@ -22,7 +22,7 @@ import { __assign, __spreadArrays } from "tslib"; | ||
var inputClasses = Array.isArray(inputOptions.classes) ? inputOptions.classes : [inputOptions.classes]; | ||
var state = function (props, options) { | ||
var state = function (props, ref, options) { | ||
if (inputOptions.state) { | ||
return inputOptions.state(parentOptions.state(props, options), options); | ||
return inputOptions.state(parentOptions.state(props, ref, options), ref, options); | ||
} | ||
return parentOptions.state(props, options); | ||
return parentOptions.state(props, ref, options); | ||
}; | ||
@@ -29,0 +29,0 @@ return { |
@@ -42,3 +42,3 @@ import * as React from 'react'; | ||
shorthandConfig?: ShorthandConfig<TParentProps & TInputProps>; | ||
state?: (props: TState, options: ComposePreparedOptions) => any; | ||
state?: (props: TState, ref: React.Ref<HTMLElement>, options: ComposePreparedOptions) => any; | ||
}; | ||
@@ -78,5 +78,5 @@ export declare type MergePropsResult<TState extends GenericDictionary> = { | ||
slotProps: ((props: TProps) => Record<string, object>)[]; | ||
state: (props: TParentState, options: ComposePreparedOptions) => TInputState; | ||
state: (props: TParentState, ref: React.Ref<HTMLElement>, options: ComposePreparedOptions) => TInputState; | ||
resolveSlotProps: <TResolvedProps>(props: TResolvedProps) => Record<string, object>; | ||
shorthandConfig: ShorthandConfig<TProps>; | ||
}; |
@@ -1,5 +0,5 @@ | ||
// @fluentui/react-compose@0.11.1 | ||
// @fluentui/react-compose@0.11.2 | ||
// Do not modify this file, the file is generated as part of publish. The checked in version is a placeholder only. | ||
import { setVersion } from '@uifabric/set-version'; | ||
setVersion('@fluentui/react-compose', '0.11.1'); | ||
setVersion('@fluentui/react-compose', '0.11.2'); | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@fluentui/react-compose", | ||
"version": "0.11.1", | ||
"version": "0.11.2", | ||
"description": "Fluent UI React component composition.", | ||
@@ -5,0 +5,0 @@ "main": "lib-commonjs/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
343422
4546