@fluentui/react-tag-picker 9.7.6 → 9.7.8
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/CHANGELOG.md +41 -2
- package/lib/components/TagPicker/TagPicker.js +1 -0
- package/lib/components/TagPicker/TagPicker.js.map +1 -1
- package/lib/components/TagPicker/renderTagPicker.js +2 -2
- package/lib/components/TagPicker/renderTagPicker.js.map +1 -1
- package/lib/components/TagPicker/useTagPicker.js +1 -0
- package/lib/components/TagPicker/useTagPicker.js.map +1 -1
- package/lib/components/TagPicker/useTagPickerContextValues.js +1 -0
- package/lib/components/TagPicker/useTagPickerContextValues.js.map +1 -1
- package/lib/components/TagPickerButton/TagPickerButton.js +1 -0
- package/lib/components/TagPickerButton/TagPickerButton.js.map +1 -1
- package/lib/components/TagPickerButton/useTagPickerButton.js +1 -0
- package/lib/components/TagPickerButton/useTagPickerButton.js.map +1 -1
- package/lib/components/TagPickerButton/useTagPickerButtonStyles.styles.js +2 -0
- package/lib/components/TagPickerButton/useTagPickerButtonStyles.styles.js.map +1 -1
- package/lib/components/TagPickerButton/useTagPickerButtonStyles.styles.raw.js +1 -0
- package/lib/components/TagPickerButton/useTagPickerButtonStyles.styles.raw.js.map +1 -1
- package/lib/components/TagPickerControl/TagPickerControl.js +1 -0
- package/lib/components/TagPickerControl/TagPickerControl.js.map +1 -1
- package/lib/components/TagPickerControl/useTagPickerControl.js +1 -0
- package/lib/components/TagPickerControl/useTagPickerControl.js.map +1 -1
- package/lib/components/TagPickerControl/useTagPickerControlStyles.styles.js +2 -0
- package/lib/components/TagPickerControl/useTagPickerControlStyles.styles.js.map +1 -1
- package/lib/components/TagPickerControl/useTagPickerControlStyles.styles.raw.js +1 -0
- package/lib/components/TagPickerControl/useTagPickerControlStyles.styles.raw.js.map +1 -1
- package/lib/components/TagPickerGroup/TagPickerGroup.js +1 -0
- package/lib/components/TagPickerGroup/TagPickerGroup.js.map +1 -1
- package/lib/components/TagPickerGroup/useTagPickerGroup.js +1 -0
- package/lib/components/TagPickerGroup/useTagPickerGroup.js.map +1 -1
- package/lib/components/TagPickerGroup/useTagPickerGroupStyles.styles.js +2 -0
- package/lib/components/TagPickerGroup/useTagPickerGroupStyles.styles.js.map +1 -1
- package/lib/components/TagPickerGroup/useTagPickerGroupStyles.styles.raw.js +1 -0
- package/lib/components/TagPickerGroup/useTagPickerGroupStyles.styles.raw.js.map +1 -1
- package/lib/components/TagPickerInput/TagPickerInput.js +1 -0
- package/lib/components/TagPickerInput/TagPickerInput.js.map +1 -1
- package/lib/components/TagPickerInput/useTagPickerInput.js +1 -0
- package/lib/components/TagPickerInput/useTagPickerInput.js.map +1 -1
- package/lib/components/TagPickerInput/useTagPickerInputStyles.styles.js +2 -0
- package/lib/components/TagPickerInput/useTagPickerInputStyles.styles.js.map +1 -1
- package/lib/components/TagPickerInput/useTagPickerInputStyles.styles.raw.js +1 -0
- package/lib/components/TagPickerInput/useTagPickerInputStyles.styles.raw.js.map +1 -1
- package/lib/components/TagPickerList/TagPickerList.js +1 -0
- package/lib/components/TagPickerList/TagPickerList.js.map +1 -1
- package/lib/components/TagPickerList/useTagPickerList.js +1 -0
- package/lib/components/TagPickerList/useTagPickerList.js.map +1 -1
- package/lib/components/TagPickerList/useTagPickerListStyles.styles.js +2 -0
- package/lib/components/TagPickerList/useTagPickerListStyles.styles.js.map +1 -1
- package/lib/components/TagPickerList/useTagPickerListStyles.styles.raw.js +1 -0
- package/lib/components/TagPickerList/useTagPickerListStyles.styles.raw.js.map +1 -1
- package/lib/components/TagPickerOption/TagPickerOption.js +1 -0
- package/lib/components/TagPickerOption/TagPickerOption.js.map +1 -1
- package/lib/components/TagPickerOption/useTagPickerOption.js +1 -0
- package/lib/components/TagPickerOption/useTagPickerOption.js.map +1 -1
- package/lib/components/TagPickerOption/useTagPickerOptionStyles.styles.js +2 -0
- package/lib/components/TagPickerOption/useTagPickerOptionStyles.styles.js.map +1 -1
- package/lib/components/TagPickerOption/useTagPickerOptionStyles.styles.raw.js +1 -0
- package/lib/components/TagPickerOption/useTagPickerOptionStyles.styles.raw.js.map +1 -1
- package/lib/components/TagPickerOptionGroup/TagPickerOptionGroup.js +1 -0
- package/lib/components/TagPickerOptionGroup/TagPickerOptionGroup.js.map +1 -1
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js +2 -0
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js.map +1 -1
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.raw.js +1 -0
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.raw.js.map +1 -1
- package/lib/contexts/TagPickerContext.js +1 -0
- package/lib/contexts/TagPickerContext.js.map +1 -1
- package/lib/utils/useExpandLabel.js +1 -0
- package/lib/utils/useExpandLabel.js.map +1 -1
- package/lib/utils/useResizeObserverRef.js +1 -0
- package/lib/utils/useResizeObserverRef.js.map +1 -1
- package/lib/utils/useTagPickerFilter.js +1 -0
- package/lib/utils/useTagPickerFilter.js.map +1 -1
- package/lib-commonjs/components/TagPicker/TagPicker.js +1 -0
- package/lib-commonjs/components/TagPicker/TagPicker.js.map +1 -1
- package/lib-commonjs/components/TagPicker/renderTagPicker.js +2 -2
- package/lib-commonjs/components/TagPicker/renderTagPicker.js.map +1 -1
- package/lib-commonjs/components/TagPicker/useTagPicker.js +1 -0
- package/lib-commonjs/components/TagPicker/useTagPicker.js.map +1 -1
- package/lib-commonjs/components/TagPicker/useTagPickerContextValues.js +1 -0
- package/lib-commonjs/components/TagPicker/useTagPickerContextValues.js.map +1 -1
- package/lib-commonjs/components/TagPickerButton/TagPickerButton.js +1 -0
- package/lib-commonjs/components/TagPickerButton/TagPickerButton.js.map +1 -1
- package/lib-commonjs/components/TagPickerButton/useTagPickerButton.js +1 -0
- package/lib-commonjs/components/TagPickerButton/useTagPickerButton.js.map +1 -1
- package/lib-commonjs/components/TagPickerButton/useTagPickerButtonStyles.styles.js +1 -0
- package/lib-commonjs/components/TagPickerButton/useTagPickerButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerButton/useTagPickerButtonStyles.styles.raw.js +1 -0
- package/lib-commonjs/components/TagPickerButton/useTagPickerButtonStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/TagPickerControl/TagPickerControl.js +1 -0
- package/lib-commonjs/components/TagPickerControl/TagPickerControl.js.map +1 -1
- package/lib-commonjs/components/TagPickerControl/useTagPickerControl.js +1 -0
- package/lib-commonjs/components/TagPickerControl/useTagPickerControl.js.map +1 -1
- package/lib-commonjs/components/TagPickerControl/useTagPickerControlStyles.styles.js +1 -0
- package/lib-commonjs/components/TagPickerControl/useTagPickerControlStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerControl/useTagPickerControlStyles.styles.raw.js +1 -0
- package/lib-commonjs/components/TagPickerControl/useTagPickerControlStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/TagPickerGroup/TagPickerGroup.js +1 -0
- package/lib-commonjs/components/TagPickerGroup/TagPickerGroup.js.map +1 -1
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroup.js +1 -0
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroup.js.map +1 -1
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroupStyles.styles.js +1 -0
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroupStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroupStyles.styles.raw.js +1 -0
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroupStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/TagPickerInput/TagPickerInput.js +1 -0
- package/lib-commonjs/components/TagPickerInput/TagPickerInput.js.map +1 -1
- package/lib-commonjs/components/TagPickerInput/useTagPickerInput.js +1 -0
- package/lib-commonjs/components/TagPickerInput/useTagPickerInput.js.map +1 -1
- package/lib-commonjs/components/TagPickerInput/useTagPickerInputStyles.styles.js +1 -0
- package/lib-commonjs/components/TagPickerInput/useTagPickerInputStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerInput/useTagPickerInputStyles.styles.raw.js +1 -0
- package/lib-commonjs/components/TagPickerInput/useTagPickerInputStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/TagPickerList/TagPickerList.js +1 -0
- package/lib-commonjs/components/TagPickerList/TagPickerList.js.map +1 -1
- package/lib-commonjs/components/TagPickerList/useTagPickerList.js +1 -0
- package/lib-commonjs/components/TagPickerList/useTagPickerList.js.map +1 -1
- package/lib-commonjs/components/TagPickerList/useTagPickerListStyles.styles.js +1 -0
- package/lib-commonjs/components/TagPickerList/useTagPickerListStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerList/useTagPickerListStyles.styles.raw.js +1 -0
- package/lib-commonjs/components/TagPickerList/useTagPickerListStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/TagPickerOption/TagPickerOption.js +1 -0
- package/lib-commonjs/components/TagPickerOption/TagPickerOption.js.map +1 -1
- package/lib-commonjs/components/TagPickerOption/useTagPickerOption.js +1 -0
- package/lib-commonjs/components/TagPickerOption/useTagPickerOption.js.map +1 -1
- package/lib-commonjs/components/TagPickerOption/useTagPickerOptionStyles.styles.js +1 -0
- package/lib-commonjs/components/TagPickerOption/useTagPickerOptionStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerOption/useTagPickerOptionStyles.styles.raw.js +1 -0
- package/lib-commonjs/components/TagPickerOption/useTagPickerOptionStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/TagPickerOptionGroup/TagPickerOptionGroup.js +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/TagPickerOptionGroup.js.map +1 -1
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js.map +1 -1
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.raw.js +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/contexts/TagPickerContext.js +1 -0
- package/lib-commonjs/contexts/TagPickerContext.js.map +1 -1
- package/lib-commonjs/utils/useExpandLabel.js +1 -0
- package/lib-commonjs/utils/useExpandLabel.js.map +1 -1
- package/lib-commonjs/utils/useResizeObserverRef.js +1 -0
- package/lib-commonjs/utils/useResizeObserverRef.js.map +1 -1
- package/lib-commonjs/utils/useTagPickerFilter.js +1 -0
- package/lib-commonjs/utils/useTagPickerFilter.js.map +1 -1
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useTagPickerOptionStyles.styles.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["useTagPickerOptionStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { useOptionStyles_unstable } from '@fluentui/react-combobox';\nimport { typographyStyles } from '@fluentui/react-theme';\nexport const tagPickerOptionClassNames = {\n root: 'fui-TagPickerOption',\n media: 'fui-TagPickerOption__media',\n secondaryContent: 'fui-TagPickerOption__secondaryContent'\n};\nconst useRootBaseStyle = makeResetStyles({\n display: 'flex',\n alignItems: 'center'\n});\nconst useRootStyles = makeStyles({\n secondaryContent: {\n display: 'grid',\n gridTemplateColumns: 'auto 1fr'\n }\n});\nconst useSecondaryContentBaseStyle = makeResetStyles({\n gridColumnStart: 2,\n gridRowStart: 2,\n ...typographyStyles.caption1\n});\nconst useMediaBaseStyle = makeResetStyles({\n gridRowStart: 'span 2'\n});\n/**\n * Apply styling to the TagPickerOption slots based on the state\n */ export const useTagPickerOptionStyles_unstable = (state)=>{\n 'use no memo';\n const rootBaseStyle = useRootBaseStyle();\n const rootStyles = useRootStyles();\n const secondaryContentBaseStyle = useSecondaryContentBaseStyle();\n const mediaBaseStyle = useMediaBaseStyle();\n state.root.className = mergeClasses(tagPickerOptionClassNames.root, rootBaseStyle, state.secondaryContent && rootStyles.secondaryContent, state.root.className);\n useOptionStyles_unstable({\n ...state,\n active: false,\n disabled: false,\n focusVisible: false,\n checkIcon: undefined,\n selected: false\n });\n if (state.media) {\n state.media.className = mergeClasses(tagPickerOptionClassNames.media, mediaBaseStyle, state.media.className);\n }\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(tagPickerOptionClassNames.secondaryContent, secondaryContentBaseStyle, state.secondaryContent.className);\n }\n return state;\n};\n"],"names":["__resetStyles","__styles","mergeClasses","useOptionStyles_unstable","typographyStyles","tagPickerOptionClassNames","root","media","secondaryContent","useRootBaseStyle","useRootStyles","mc9l5x","Budl1dq","d","useSecondaryContentBaseStyle","useMediaBaseStyle","useTagPickerOptionStyles_unstable","state","rootBaseStyle","rootStyles","secondaryContentBaseStyle","mediaBaseStyle","className","active","disabled","focusVisible","checkIcon","undefined","selected"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAICK,yBAAyB;;;qCAyBY;eAAjCW;;;uBA5ByC,gBAAgB;+BACjC,0BAA0B;AAE5D,kCAAkC;IACrCV,IAAI,EAAE,qBAAqB;IAC3BC,KAAK,EAAE,4BAA4B;IACnCC,gBAAgB,EAAE;AACtB,CAAC;AACD,MAAMC,gBAAgB,GAAA,WAAA,OAAGT,oBAAA,EAAA,WAAA,MAAA;IAAA;CAGxB,CAAC;AACF,MAAMU,aAAa,GAAA,WAAA,OAAGT,eAAA,EAAA;IAAAO,gBAAA,EAAA;QAAAG,MAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAAA,EAAA;QAAA;QAAA;KAAA;AAAA,CAKrB,CAAC;AACF,MAAMC,4BAA4B,GAAA,WAAA,OAAGd,oBAAA,EAAA,YAAA,MAAA;IAAA;CAIpC,CAAC;AACF,MAAMe,iBAAiB,GAAA,WAAA,OAAGf,oBAAA,EAAA,WAAA,MAAA;IAAA;CAEzB,CAAC;AAGS,2CAA2CiB,KAAK,IAAG;IAC1D,aAAa;IACb,MAAMC,aAAa,GAAGT,gBAAgB,CAAC,CAAC;IACxC,MAAMU,UAAU,GAAGT,aAAa,CAAC,CAAC;IAClC,MAAMU,yBAAyB,GAAGN,4BAA4B,CAAC,CAAC;IAChE,MAAMO,cAAc,GAAGN,iBAAiB,CAAC,CAAC;IAC1CE,KAAK,CAACX,IAAI,CAACgB,SAAS,OAAGpB,mBAAY,EAACG,yBAAyB,CAACC,IAAI,EAAEY,aAAa,EAAED,KAAK,CAACT,gBAAgB,IAAIW,UAAU,CAACX,gBAAgB,EAAES,KAAK,CAACX,IAAI,CAACgB,SAAS,CAAC;QAC/JnB,uCAAwB,EAAC;QACrB,GAAGc,KAAK;QACRM,MAAM,EAAE,KAAK;QACbC,QAAQ,EAAE,KAAK;QACfC,YAAY,EAAE,KAAK;QACnBC,SAAS,EAAEC,SAAS;QACpBC,QAAQ,EAAE;IACd,CAAC,CAAC;IACF,IAAIX,KAAK,CAACV,KAAK,EAAE;QACbU,KAAK,CAACV,KAAK,CAACe,SAAS,GAAGpB,uBAAY,EAACG,yBAAyB,CAACE,KAAK,EAAEc,cAAc,EAAEJ,KAAK,CAACV,KAAK,CAACe,SAAS,CAAC;IAChH;IACA,IAAIL,KAAK,CAACT,gBAAgB,EAAE;QACxBS,KAAK,CAACT,gBAAgB,CAACc,SAAS,OAAGpB,mBAAY,EAACG,yBAAyB,CAACG,gBAAgB,EAAEY,yBAAyB,EAAEH,KAAK,CAACT,gBAAgB,CAACc,SAAS,CAAC;IAC5J;IACA,OAAOL,KAAK;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOption/useTagPickerOptionStyles.styles.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOption/useTagPickerOptionStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerOptionSlots, TagPickerOptionState } from './TagPickerOption.types';\nimport { useOptionStyles_unstable } from '@fluentui/react-combobox';\nimport { typographyStyles } from '@fluentui/react-theme';\n\nexport const tagPickerOptionClassNames: SlotClassNames<TagPickerOptionSlots> = {\n root: 'fui-TagPickerOption',\n media: 'fui-TagPickerOption__media',\n secondaryContent: 'fui-TagPickerOption__secondaryContent',\n};\n\nconst useRootBaseStyle = makeResetStyles({\n display: 'flex',\n alignItems: 'center',\n});\n\nconst useRootStyles = makeStyles({\n secondaryContent: {\n display: 'grid',\n gridTemplateColumns: 'auto 1fr',\n },\n});\n\nconst useSecondaryContentBaseStyle = makeResetStyles({\n gridColumnStart: 2,\n gridRowStart: 2,\n ...typographyStyles.caption1,\n});\n\nconst useMediaBaseStyle = makeResetStyles({\n gridRowStart: 'span 2',\n});\n\n/**\n * Apply styling to the TagPickerOption slots based on the state\n */\nexport const useTagPickerOptionStyles_unstable = (state: TagPickerOptionState): TagPickerOptionState => {\n 'use no memo';\n\n const rootBaseStyle = useRootBaseStyle();\n const rootStyles = useRootStyles();\n const secondaryContentBaseStyle = useSecondaryContentBaseStyle();\n const mediaBaseStyle = useMediaBaseStyle();\n\n state.root.className = mergeClasses(\n tagPickerOptionClassNames.root,\n rootBaseStyle,\n state.secondaryContent && rootStyles.secondaryContent,\n state.root.className,\n );\n useOptionStyles_unstable({\n ...state,\n active: false,\n disabled: false,\n focusVisible: false,\n checkIcon: undefined,\n selected: false,\n });\n if (state.media) {\n state.media.className = mergeClasses(tagPickerOptionClassNames.media, mediaBaseStyle, state.media.className);\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n tagPickerOptionClassNames.secondaryContent,\n secondaryContentBaseStyle,\n state.secondaryContent.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","useOptionStyles_unstable","typographyStyles","tagPickerOptionClassNames","root","media","secondaryContent","useRootBaseStyle","display","alignItems","useRootStyles","gridTemplateColumns","useSecondaryContentBaseStyle","gridColumnStart","gridRowStart","caption1","useMediaBaseStyle","useTagPickerOptionStyles_unstable","state","rootBaseStyle","rootStyles","secondaryContentBaseStyle","mediaBaseStyle","className","active","disabled","focusVisible","checkIcon","undefined","selected"],"mappings":"AAAA;;;;;;;;;;;;IAQaK,yBAAAA;;;qCA+BAc;eAAAA;;;uBArC6C,iBAAiB;+BAGlC,2BAA2B;4BACnC,wBAAwB;AAElD,kCAAwE;IAC7Eb,MAAM;IACNC,OAAO;IACPC,kBAAkB;AACpB,EAAE;AAEF,MAAMC,uBAAmBT,sBAAAA,EAAgB;IACvCU,SAAS;IACTC,YAAY;AACd;AAEA,MAAMC,oBAAgBX,iBAAAA,EAAW;IAC/BO,kBAAkB;QAChBE,SAAS;QACTG,qBAAqB;IACvB;AACF;AAEA,MAAMC,mCAA+Bd,sBAAAA,EAAgB;IACnDe,iBAAiB;IACjBC,cAAc;IACd,GAAGZ,4BAAAA,CAAiBa,QAAQ;AAC9B;AAEA,MAAMC,wBAAoBlB,sBAAAA,EAAgB;IACxCgB,cAAc;AAChB;AAKO,0CAA0C,CAACI;IAChD;IAEA,MAAMC,gBAAgBZ;IACtB,MAAMa,aAAaV;IACnB,MAAMW,4BAA4BT;IAClC,MAAMU,iBAAiBN;IAEvBE,MAAMd,IAAI,CAACmB,SAAS,OAAGvB,mBAAAA,EACrBG,0BAA0BC,IAAI,EAC9Be,eACAD,MAAMZ,gBAAgB,IAAIc,WAAWd,gBAAgB,EACrDY,MAAMd,IAAI,CAACmB,SAAS;QAEtBtB,uCAAAA,EAAyB;QACvB,GAAGiB,KAAK;QACRM,QAAQ;QACRC,UAAU;QACVC,cAAc;QACdC,WAAWC;QACXC,UAAU;IACZ;IACA,IAAIX,MAAMb,KAAK,EAAE;QACfa,MAAMb,KAAK,CAACkB,SAAS,OAAGvB,mBAAAA,EAAaG,0BAA0BE,KAAK,EAAEiB,gBAAgBJ,MAAMb,KAAK,CAACkB,SAAS;IAC7G;IAEA,IAAIL,MAAMZ,gBAAgB,EAAE;QAC1BY,MAAMZ,gBAAgB,CAACiB,SAAS,OAAGvB,mBAAAA,EACjCG,0BAA0BG,gBAAgB,EAC1Ce,2BACAH,MAAMZ,gBAAgB,CAACiB,SAAS;IAEpC;IAEA,OAAOL;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOptionGroup/TagPickerOptionGroup.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOptionGroup/TagPickerOptionGroup.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTagPickerOptionGroup } from './useTagPickerOptionGroup';\nimport { renderTagPickerOptionGroup } from './renderTagPickerOptionGroup';\nimport { useTagPickerOptionGroupStyles } from './useTagPickerOptionGroupStyles.styles';\nimport type { TagPickerOptionGroupProps } from './TagPickerOptionGroup.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * TagPickerOptionGroup component -\n * A TagPickerOptionGroup is a composite component that allows users to group TagPickerOptions.\n */\nexport const TagPickerOptionGroup: ForwardRefComponent<TagPickerOptionGroupProps> = React.forwardRef((props, ref) => {\n const state = useTagPickerOptionGroup(props, ref);\n\n useTagPickerOptionGroupStyles(state);\n useCustomStyleHook_unstable('useTagPickerOptionGroupStyles_unstable')(state);\n return renderTagPickerOptionGroup(state);\n});\n\nTagPickerOptionGroup.displayName = 'TagPickerOptionGroup';\n"],"names":["React","useTagPickerOptionGroup","renderTagPickerOptionGroup","useTagPickerOptionGroupStyles","useCustomStyleHook_unstable","TagPickerOptionGroup","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;yCAES,4BAA4B;4CACzB,+BAA+B;qDAC5B,yCAAyC;qCAE3C,kCAAkC;AAMvE,MAAMK,uBAAAA,WAAAA,GAAuEL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IAC3G,MAAMC,YAAQR,gDAAAA,EAAwBM,OAAOC;QAE7CL,kEAAAA,EAA8BM;QAC9BL,gDAAAA,EAA4B,0CAA0CK;IACtE,WAAOP,sDAAAA,EAA2BO;AACpC,GAAG;AAEHJ,qBAAqBK,WAAW,GAAG"}
|
package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useTagPickerOptionGroupStyles.styles.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["useTagPickerOptionGroupStyles.styles.js"],"sourcesContent":["'use client';\nimport { mergeClasses } from '@griffel/react';\nimport { useOptionGroupStyles_unstable } from '@fluentui/react-combobox';\nexport const tagPickerOptionGroupClassNames = {\n root: 'fui-TagPickerOptionGroup',\n label: 'fui-TagPickerOptionGroup__label'\n};\n/**\n * Apply styling to the TagPickerOptionGroup slots based on the state\n */ export const useTagPickerOptionGroupStyles = (state)=>{\n 'use no memo';\n useOptionGroupStyles_unstable(state);\n state.root.className = mergeClasses(tagPickerOptionGroupClassNames.root, state.root.className);\n if (state.label) {\n state.label.className = mergeClasses(tagPickerOptionGroupClassNames.label, state.label.className);\n }\n return state;\n};\n"],"names":["mergeClasses","useOptionGroupStyles_unstable","tagPickerOptionGroupClassNames","root","label","useTagPickerOptionGroupStyles","state","className"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAGCE,8BAA8B;;;iCAMG;eAA7BG;;;uBARY,gBAAgB;+BACC,0BAA0B;AACjE,uCAAuC;IAC1CF,IAAI,EAAE,0BAA0B;IAChCC,KAAK,EAAE;AACX,CAAC;AAGU,uCAAuCE,KAAK,IAAG;IACtD,aAAa;QACbL,4CAA6B,EAACK,KAAK,CAAC;IACpCA,KAAK,CAACH,IAAI,CAACI,SAAS,OAAGP,mBAAY,EAACE,8BAA8B,CAACC,IAAI,EAAEG,KAAK,CAACH,IAAI,CAACI,SAAS,CAAC;IAC9F,IAAID,KAAK,CAACF,KAAK,EAAE;QACbE,KAAK,CAACF,KAAK,CAACG,SAAS,OAAGP,mBAAY,EAACE,8BAA8B,CAACE,KAAK,EAAEE,KAAK,CAACF,KAAK,CAACG,SAAS,CAAC;IACrG;IACA,OAAOD,KAAK;AAChB,CAAC"}
|
package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.raw.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerOptionGroupSlots, TagPickerOptionGroupState } from './TagPickerOptionGroup.types';\nimport { useOptionGroupStyles_unstable } from '@fluentui/react-combobox';\n\nexport const tagPickerOptionGroupClassNames: SlotClassNames<TagPickerOptionGroupSlots> = {\n root: 'fui-TagPickerOptionGroup',\n label: 'fui-TagPickerOptionGroup__label',\n};\n\n/**\n * Apply styling to the TagPickerOptionGroup slots based on the state\n */\nexport const useTagPickerOptionGroupStyles = (state: TagPickerOptionGroupState): TagPickerOptionGroupState => {\n 'use no memo';\n\n useOptionGroupStyles_unstable(state);\n state.root.className = mergeClasses(tagPickerOptionGroupClassNames.root, state.root.className);\n\n if (state.label) {\n state.label.className = mergeClasses(tagPickerOptionGroupClassNames.label, state.label.className);\n }\n\n return state;\n};\n"],"names":["mergeClasses","useOptionGroupStyles_unstable","tagPickerOptionGroupClassNames","root","label","useTagPickerOptionGroupStyles","state","className"],"mappings":"AAAA;;;;;;;;;;;;IAOaE,8BAAAA;;;iCAQAG;eAAAA;;;uBAbgB,iBAAiB;+BAGA,2BAA2B;AAElE,uCAAkF;IACvFF,MAAM;IACNC,OAAO;AACT,EAAE;AAKK,sCAAsC,CAACE;IAC5C;QAEAL,4CAAAA,EAA8BK;IAC9BA,MAAMH,IAAI,CAACI,SAAS,OAAGP,mBAAAA,EAAaE,+BAA+BC,IAAI,EAAEG,MAAMH,IAAI,CAACI,SAAS;IAE7F,IAAID,MAAMF,KAAK,EAAE;QACfE,MAAMF,KAAK,CAACG,SAAS,OAAGP,mBAAAA,EAAaE,+BAA+BE,KAAK,EAAEE,MAAMF,KAAK,CAACG,SAAS;IAClG;IAEA,OAAOD;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/contexts/TagPickerContext.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/contexts/TagPickerContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ContextSelector, createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { TagPickerSize } from '../components/TagPicker/TagPicker.types';\nimport { ComboboxBaseState } from '@fluentui/react-combobox';\n\nexport interface TagPickerContextValue\n extends Pick<\n ComboboxBaseState,\n | 'open'\n | 'clearSelection'\n | 'getOptionById'\n | 'selectedOptions'\n | 'selectOption'\n | 'setHasFocus'\n | 'setOpen'\n | 'setValue'\n | 'value'\n | 'appearance'\n | 'disabled'\n > {\n triggerRef: React.RefObject<HTMLInputElement | HTMLButtonElement | null>;\n popoverRef: React.RefObject<HTMLDivElement | null>;\n popoverId: string;\n targetRef: React.RefObject<HTMLDivElement | null>;\n secondaryActionRef: React.RefObject<HTMLSpanElement | null>;\n tagPickerGroupRef: React.RefObject<HTMLDivElement | null>;\n size: TagPickerSize;\n noPopover?: boolean;\n}\n\n/**\n * @internal\n */\nexport const tagPickerContextDefaultValue: TagPickerContextValue = {\n triggerRef: React.createRef<HTMLInputElement>(),\n popoverRef: React.createRef<HTMLDivElement>(),\n targetRef: React.createRef<HTMLDivElement>(),\n tagPickerGroupRef: React.createRef<HTMLDivElement>(),\n secondaryActionRef: React.createRef<HTMLDivElement>(),\n open: false,\n clearSelection: () => null,\n getOptionById: () => undefined,\n selectedOptions: [],\n selectOption: () => null,\n setHasFocus: () => null,\n setOpen: () => null,\n setValue: () => null,\n value: undefined,\n popoverId: '',\n size: 'medium',\n appearance: 'outline',\n disabled: false,\n};\n\nconst TagPickerContext = createContext<TagPickerContextValue | undefined>(undefined);\n\nexport const TagPickerContextProvider = TagPickerContext.Provider;\nexport const useTagPickerContext_unstable = <T>(selector: ContextSelector<TagPickerContextValue, T>): T =>\n useContextSelector(TagPickerContext, (ctx = tagPickerContextDefaultValue) => selector(ctx));\n"],"names":["React","createContext","useContextSelector","tagPickerContextDefaultValue","triggerRef","createRef","popoverRef","targetRef","tagPickerGroupRef","secondaryActionRef","open","clearSelection","getOptionById","undefined","selectedOptions","selectOption","setHasFocus","setOpen","setValue","value","popoverId","size","appearance","disabled","TagPickerContext","TagPickerContextProvider","Provider","useTagPickerContext_unstable","selector","ctx"],"mappings":"AAAA;;;;;;;;;;;;4BA0DayB;;;gCAvBAtB;;;gCAwBAwB;;;;;iEAzDU,QAAQ;sCACoC,mCAAmC;AAgC/F,MAAMxB,+BAAsD;IACjEC,0BAAYJ,OAAMK,SAAS;IAC3BC,0BAAYN,OAAMK,SAAS;IAC3BE,yBAAWP,OAAMK,SAAS;IAC1BG,iCAAmBR,OAAMK,SAAS;IAClCI,kCAAoBT,OAAMK,SAAS;IACnCK,MAAM;IACNC,gBAAgB,IAAM;IACtBC,eAAe,IAAMC;IACrBC,iBAAiB,EAAE;IACnBC,cAAc,IAAM;IACpBC,aAAa,IAAM;IACnBC,SAAS,IAAM;IACfC,UAAU,IAAM;IAChBC,OAAON;IACPO,WAAW;IACXC,MAAM;IACNC,YAAY;IACZC,UAAU;AACZ,EAAE;AAEF,MAAMC,uBAAmBvB,mCAAAA,EAAiDY;AAEnE,MAAMY,2BAA2BD,iBAAiBE,QAAQ,CAAC;AAC3D,MAAMC,+BAA+B,CAAIC,eAC9C1B,wCAAAA,EAAmBsB,kBAAkB,CAACK,MAAM1B,4BAA4B,GAAKyB,SAASC,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/useExpandLabel.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/utils/useExpandLabel.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useTagPickerContext_unstable } from '../contexts/TagPickerContext';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { TagPickerControlState } from '../TagPickerControl';\n\nexport function useExpandLabel(options: {\n tagPickerId: string;\n state: Pick<TagPickerControlState, 'expandIcon'>;\n}): React.RefObject<HTMLSpanElement | null> {\n const { tagPickerId, state } = options;\n const { targetDocument } = useFluent();\n const triggerRef = useTagPickerContext_unstable(ctx => ctx.triggerRef);\n const expandIconRef = React.useRef<HTMLSpanElement | null>(null);\n\n const hasExpandIcon = !!state.expandIcon;\n const {\n 'aria-label': expandIconAriaLabel,\n 'aria-labelledby': expandIconAriaLabelledby,\n id: expandIconId,\n } = state.expandIcon || {};\n\n // If aria-label or aria-labelledby changes, recalculate aria-label and aria-labelledby for the expandIcon\n // The expandIcon's label is calculated based on the input's label\n // TODO: investigate ways to enforce client to provide a label rather than need to calculate it\n const getExpandLabel = React.useCallback(\n (ariaLabel?: string | null, ariaLabelledBy?: string | null) => {\n let expandAriaLabel = undefined;\n let expandAriaLabelledBy = undefined;\n let expandId = undefined;\n\n if (hasExpandIcon) {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n // If there is no explicit aria-label, calculate default accName attribute for expandIcon button,\n // using the following steps:\n // 1. If there is an aria-label, it is \"Open [aria-label]\"\n // 2. If there is an aria-labelledby, it is \"Open [aria-labelledby target]\" (using aria-labelledby + ids)\n // 3. If there is no aria-label/ledby attr, it falls back to \"Open\"\n // We can't fall back to a label/htmlFor name because of https://github.com/w3c/accname/issues/179\n const defaultOpenString = 'Open'; // this is english-only since it is the fallback\n if (!hasExpandLabel) {\n if (ariaLabelledBy) {\n expandAriaLabel = defaultOpenString;\n expandId = expandIconId ?? `${tagPickerId}-chevron`;\n expandAriaLabelledBy = `${expandId} ${ariaLabelledBy}`;\n } else if (ariaLabel) {\n expandAriaLabel = `${defaultOpenString} ${ariaLabel}`;\n } else {\n expandAriaLabel = defaultOpenString;\n }\n }\n }\n\n return { expandAriaLabel, expandAriaLabelledBy, expandId };\n },\n [expandIconAriaLabel, expandIconAriaLabelledby, expandIconId, hasExpandIcon, tagPickerId],\n );\n\n const setExpandLabel = React.useCallback(() => {\n const inputAriaLabel = triggerRef.current?.getAttribute('aria-label');\n const inputAriaLabelledBy = triggerRef.current?.getAttribute('aria-labelledby');\n\n const { expandAriaLabel, expandAriaLabelledBy, expandId } = getExpandLabel(inputAriaLabel, inputAriaLabelledBy);\n\n if (expandAriaLabelledBy) {\n expandIconRef.current?.setAttribute('aria-labelledby', expandAriaLabelledBy);\n }\n if (expandAriaLabel) {\n expandIconRef.current?.setAttribute('aria-label', expandAriaLabel);\n }\n if (expandId) {\n expandIconRef.current?.setAttribute('id', expandId);\n }\n }, [getExpandLabel, triggerRef]);\n\n React.useEffect(() => {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n if (!targetDocument?.defaultView || !triggerRef.current || !hasExpandIcon || hasExpandLabel) {\n return;\n }\n\n const win = targetDocument.defaultView;\n\n // On first render, calculate the default aria-label and aria-labelledby for the expandIcon\n setExpandLabel();\n\n const observer = new win.MutationObserver(setExpandLabel);\n observer.observe(triggerRef.current, {\n attributes: true,\n attributeFilter: ['aria-label', 'aria-labelledby'],\n });\n\n return () => observer.disconnect();\n }, [\n getExpandLabel,\n setExpandLabel,\n expandIconAriaLabel,\n expandIconAriaLabelledby,\n hasExpandIcon,\n tagPickerId,\n triggerRef,\n targetDocument,\n ]);\n\n return expandIconRef;\n}\n"],"names":["React","useTagPickerContext_unstable","useFluent_unstable","useFluent","useExpandLabel","options","tagPickerId","state","targetDocument","triggerRef","ctx","expandIconRef","useRef","hasExpandIcon","expandIcon","expandIconAriaLabel","expandIconAriaLabelledby","id","expandIconId","getExpandLabel","useCallback","ariaLabel","ariaLabelledBy","expandAriaLabel","undefined","expandAriaLabelledBy","expandId","hasExpandLabel","defaultOpenString","setExpandLabel","inputAriaLabel","current","getAttribute","inputAriaLabelledBy","setAttribute","useEffect","defaultView","win","observer","MutationObserver","observe","attributes","attributeFilter","disconnect"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/useResizeObserverRef.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/utils/useResizeObserverRef.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\nexport const useResizeObserverRef = <E extends HTMLElement>(callback: ResizeObserverCallback): React.Ref<E> => {\n const { targetDocument } = useFluent();\n const [observer] = React.useState(() => {\n const ResizeObserverConstructor = targetDocument?.defaultView?.ResizeObserver;\n if (ResizeObserverConstructor) {\n return new ResizeObserverConstructor(callback);\n }\n });\n const ref: React.RefCallback<E> = React.useCallback(\n element => {\n if (element) {\n observer?.observe(element);\n } else {\n observer?.disconnect();\n }\n },\n [observer],\n );\n return ref;\n};\n"],"names":["React","useFluent_unstable","useFluent","useResizeObserverRef","callback","targetDocument","observer","useState","ResizeObserverConstructor","defaultView","ResizeObserver","ref","useCallback","element","observe","disconnect"],"mappings":"AAAA;;;;;+BAKaG;;;;;;;iEAHU,QAAQ;qCACiB,kCAAkC;AAE3E,6BAA6B,CAAwBC;IAC1D,MAAM,EAAEC,cAAc,EAAE,OAAGH,uCAAAA;IAC3B,MAAM,CAACI,SAAS,GAAGN,OAAMO,QAAQ,CAAC;YACEF;QAAlC,MAAMG,4BAA4BH,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,CAAAA,8BAAAA,eAAgBI,WAAAA,AAAW,MAAA,QAA3BJ,gCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,4BAA6BK,cAAc;QAC7E,IAAIF,2BAA2B;YAC7B,OAAO,IAAIA,0BAA0BJ;QACvC;IACF;IACA,MAAMO,MAA4BX,OAAMY,WAAW,CACjDC,CAAAA;QACE,IAAIA,SAAS;YACXP,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,KAAAA,IAAAA,SAAUQ,OAAO,CAACD;QACpB,OAAO;YACLP,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,KAAAA,IAAAA,SAAUS,UAAU;QACtB;IACF,GACA;QAACT;KAAS;IAEZ,OAAOK;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/useTagPickerFilter.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/utils/useTagPickerFilter.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { TagPickerOption } from '../TagPickerOption';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\ntype UseTagPickerFilterConfig = {\n query: string;\n options: string[];\n /**\n * Provides a custom filter for the option.\n * By default the filter will check if the option includes the query.\n */\n filter?: (option: string, index: number) => boolean;\n\n /** Provides an element to be displayed when there are no options. */\n noOptionsElement: JSXElement;\n\n /** Provides a custom render for the option. */\n renderOption?: (option: string) => JSXElement;\n};\n\nfunction defaultRenderOption(option: string) {\n return (\n <TagPickerOption value={option} key={option}>\n {option}\n </TagPickerOption>\n );\n}\n\nexport function useTagPickerFilter({\n filter: filterOverride,\n noOptionsElement,\n renderOption = defaultRenderOption,\n query,\n options,\n}: UseTagPickerFilterConfig): JSXElement[] {\n const defaultFilter = React.useCallback(\n (option: string) => {\n const trimmedQuery = query.trim();\n if (trimmedQuery === '') {\n return true;\n }\n return option.toLowerCase().includes(trimmedQuery.toLowerCase());\n },\n [query],\n );\n const filter = filterOverride ?? defaultFilter;\n const filteredOptions = React.useMemo(\n () =>\n options.reduce<JSXElement[]>((accumulator, option, index) => {\n if (filter(option, index)) {\n accumulator.push(renderOption(option));\n }\n return accumulator;\n }, []),\n [options, renderOption, filter],\n );\n\n return filteredOptions.length === 0\n ? [noOptionsElement.key ? noOptionsElement : React.cloneElement(noOptionsElement, { key: 'no-options' })]\n : filteredOptions;\n}\n"],"names":["React","TagPickerOption","defaultRenderOption","option","value","key","useTagPickerFilter","filter","filterOverride","noOptionsElement","renderOption","query","options","defaultFilter","useCallback","trimmedQuery","trim","toLowerCase","includes","filteredOptions","useMemo","reduce","accumulator","index","push","length","cloneElement"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;iCACC,qBAAqB;AAmBrD,SAASE,oBAAoBC,MAAc;IACzC,OAAA,WAAA,GACE,OAAA,aAAA,CAACF,gCAAAA,EAAAA;QAAgBG,OAAOD;QAAQE,KAAKF;OAClCA;AAGP;AAEO,SAASG,mBAAmB,EACjCC,QAAQC,cAAc,EACtBC,gBAAgB,EAChBC,eAAeR,mBAAmB,EAClCS,KAAK,EACLC,OAAO,EACkB;IACzB,MAAMC,gBAAgBb,OAAMc,WAAW,CACrC,CAACX;QACC,MAAMY,eAAeJ,MAAMK,IAAI;QAC/B,IAAID,iBAAiB,IAAI;YACvB,OAAO;QACT;QACA,OAAOZ,OAAOc,WAAW,GAAGC,QAAQ,CAACH,aAAaE,WAAW;IAC/D,GACA;QAACN;KAAM;IAET,MAAMJ,SAASC,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,iBAAkBK;IACjC,MAAMM,kBAAkBnB,OAAMoB,OAAO,CACnC,IACER,QAAQS,MAAM,CAAe,CAACC,aAAanB,QAAQoB;YACjD,IAAIhB,OAAOJ,QAAQoB,QAAQ;gBACzBD,YAAYE,IAAI,CAACd,aAAaP;YAChC;YACA,OAAOmB;QACT,GAAG,EAAE,GACP;QAACV;QAASF;QAAcH;KAAO;IAGjC,OAAOY,gBAAgBM,MAAM,KAAK,IAC9B;QAAChB,iBAAiBJ,GAAG,GAAGI,mBAAAA,WAAAA,GAAmBT,OAAM0B,YAAY,CAACjB,kBAAkB;YAAEJ,KAAK;QAAa;KAAG,GACvGc;AACN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-tag-picker",
|
|
3
|
-
"version": "9.7.
|
|
3
|
+
"version": "9.7.8",
|
|
4
4
|
"description": "FluentUI TagPicker component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -28,20 +28,20 @@
|
|
|
28
28
|
"@fluentui/scripts-cypress": "*"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@fluentui/react-jsx-runtime": "^9.2.
|
|
32
|
-
"@fluentui/react-shared-contexts": "^9.25.
|
|
31
|
+
"@fluentui/react-jsx-runtime": "^9.2.2",
|
|
32
|
+
"@fluentui/react-shared-contexts": "^9.25.2",
|
|
33
33
|
"@fluentui/react-theme": "^9.2.0",
|
|
34
|
-
"@fluentui/react-utilities": "^9.
|
|
35
|
-
"@fluentui/react-portal": "^9.8.
|
|
36
|
-
"@fluentui/react-tabster": "^9.26.
|
|
37
|
-
"@fluentui/react-aria": "^9.17.
|
|
34
|
+
"@fluentui/react-utilities": "^9.25.1",
|
|
35
|
+
"@fluentui/react-portal": "^9.8.4",
|
|
36
|
+
"@fluentui/react-tabster": "^9.26.7",
|
|
37
|
+
"@fluentui/react-aria": "^9.17.2",
|
|
38
38
|
"@fluentui/react-icons": "^2.0.245",
|
|
39
|
-
"@fluentui/react-combobox": "^9.16.
|
|
40
|
-
"@fluentui/react-tags": "^9.7.
|
|
41
|
-
"@fluentui/react-context-selector": "^9.2.
|
|
42
|
-
"@fluentui/react-positioning": "^9.20.
|
|
39
|
+
"@fluentui/react-combobox": "^9.16.8",
|
|
40
|
+
"@fluentui/react-tags": "^9.7.8",
|
|
41
|
+
"@fluentui/react-context-selector": "^9.2.9",
|
|
42
|
+
"@fluentui/react-positioning": "^9.20.7",
|
|
43
43
|
"@fluentui/keyboard-keys": "^9.0.8",
|
|
44
|
-
"@fluentui/react-field": "^9.4.
|
|
44
|
+
"@fluentui/react-field": "^9.4.7",
|
|
45
45
|
"@griffel/react": "^1.5.22",
|
|
46
46
|
"@swc/helpers": "^0.5.1"
|
|
47
47
|
},
|