@ember-eui/core 10.0.5 → 10.0.7
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/declarations/components/eui-combo-box.d.ts +6 -0
- package/declarations/components/eui-combo-box.d.ts.map +1 -1
- package/declarations/components/eui-flyout.d.ts +5 -0
- package/declarations/components/eui-flyout.d.ts.map +1 -1
- package/declarations/components/eui-header-section-item.d.ts +1 -1
- package/declarations/components/eui-header-section-item.d.ts.map +1 -1
- package/declarations/components/eui-header-section.d.ts +2 -2
- package/declarations/components/eui-header-section.d.ts.map +1 -1
- package/declarations/components/eui-page-header-content.d.ts +3 -3
- package/declarations/components/eui-page-header-content.d.ts.map +1 -1
- package/declarations/components/eui-popover.d.ts +0 -1
- package/declarations/components/eui-popover.d.ts.map +1 -1
- package/dist/components/eui-combo-box.js +1 -1
- package/dist/components/eui-combo-box.js.map +1 -1
- package/dist/components/eui-flyout.js.map +1 -1
- package/dist/components/eui-header-section-item.js.map +1 -1
- package/dist/components/eui-header-section.js.map +1 -1
- package/dist/components/eui-page-header-content.js +3 -3
- package/dist/components/eui-page-header-content.js.map +1 -1
- package/dist/components/eui-page-header.js +2 -2
- package/dist/components/eui-page-header.js.map +1 -1
- package/dist/components/eui-popover.js +1 -1
- package/dist/components/eui-popover.js.map +1 -1
- package/dist/helpers/class-names.js +1 -1
- package/dist/helpers/class-names.js.map +1 -1
- package/dist/helpers/inline-styles.js +1 -1
- package/dist/helpers/inline-styles.js.map +1 -1
- package/dist/utils/css-mappings/eui-avatar.js +1 -1
- package/dist/utils/css-mappings/eui-avatar.js.map +1 -1
- package/package.json +1 -2
- package/dist/_app_/modifiers/open-collapsible-nav.js +0 -1
- package/dist/modifiers/open-collapsible-nav.js +0 -22
- package/dist/modifiers/open-collapsible-nav.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-names.js","sources":["../../src/helpers/class-names.ts"],"sourcesContent":["import { helper } from '@ember/component/helper';\nimport { assert } from '@ember/debug';\n\n// Mappings registry\nimport cssMappings from '../utils/css-mappings/index.ts';\n\ninterface Options {\n [key: string]: unknown;\n size?: string | number | boolean | {};\n side?: string;\n paddingSize?: string;\n textAlign?: string;\n textStyle?: string;\n color?: string;\n verticalPosition?: string;\n horizontalPosition?: string;\n componentName?: keyof typeof cssMappings;\n textTransform?: string;\n display?: string;\n type?: string;\n gutterSize?: string;\n alignItems?: string;\n direction?: string;\n justifyContent?: string;\n columns?: number;\n grow?: number | string | boolean;\n iconSide?: string;\n flush?: string | boolean;\n borderSide?: string;\n position?: string;\n theme?: string;\n margin?: string;\n borderRadius?: string;\n backgroundColor?: string;\n resize?: string;\n addBase?: boolean;\n}\n\n/**\n * Joins a list of classes\n *\n * @param classes - List of classes that will be joined\n */\nexport function classNames(\n classNames: (string | undefined)[] = [],\n options: Options\n): string {\n let { componentName, ...rest } = options;\n let includeBase = options.addBase !== false;\n let str = `${classNames.join(' ')}`;\n\n if (options.componentName) {\n assert(\n `The component '${options.componentName}' doesn't have mappings defined`,\n cssMappings[options.componentName] !== undefined\n );\n\n const component = cssMappings[options.componentName]!;\n\n if (includeBase) {\n str = `${str} ${component.base}`;\n }\n\n for (let key in rest) {\n //@ts-expect-error\n if (component.properties[key] && component.properties[key]?.[rest[key]]) {\n //@ts-expect-error\n str = `${str} ${component.properties[key]?.[rest[key]]}`;\n }\n }\n }\n\n return str;\n}\n\nexport default helper<(string | undefined)[], Options, string>(classNames);\n"],"names":["classNames","options","componentName","rest","includeBase","addBase","str","join","assert","cssMappings","undefined","component","base","key","properties","helper"],"mappings":";;;;AAsCA;AACA;AACA;AACA;AACA;AACO,SAASA,UAAUA,CACxBA,UAAkC,GAAG,EAAE,EACvCC,OAAgB,EACR;EACR,IAAI;IAAEC,aAAa;IAAE,GAAGC,IAAAA;AAAK,GAAC,GAAGF,OAAO,CAAA;AACxC,EAAA,IAAIG,WAAW,GAAGH,OAAO,CAACI,OAAO,KAAK,KAAK,CAAA;EAC3C,IAAIC,GAAG,GAAI,CAAEN,EAAAA,UAAU,CAACO,IAAI,CAAC,GAAG,CAAE,CAAC,CAAA,CAAA;EAEnC,IAAIN,OAAO,CAACC,aAAa,EAAE;AACzBM,IAAAA,MAAM,CACH,CAAA,eAAA,EAAiBP,OAAO,CAACC,aAAc,CAAgC,+BAAA,CAAA,EACxEO,OAAW,CAACR,OAAO,CAACC,aAAa,CAAC,KAAKQ,SACzC,CAAC,CAAA;AAED,IAAA,MAAMC,SAAS,GAAGF,OAAW,CAACR,OAAO,CAACC,aAAa,CAAE,CAAA;AAErD,IAAA,IAAIE,WAAW,EAAE;AACfE,MAAAA,GAAG,GAAI,CAAEA,EAAAA,GAAI,IAAGK,SAAS,CAACC,IAAK,CAAC,CAAA,CAAA;AAClC,KAAA;AAEA,IAAA,KAAK,IAAIC,GAAG,IAAIV,IAAI,EAAE;AACpB;AACA,MAAA,IAAIQ,SAAS,CAACG,UAAU,CAACD,GAAG,CAAC,IAAIF,SAAS,CAACG,UAAU,CAACD,GAAG,CAAC,GAAGV,IAAI,CAACU,GAAG,CAAC,CAAC,EAAE;AACvE;AACAP,QAAAA,GAAG,GAAI,CAAEA,EAAAA,GAAI,CAAGK,CAAAA,EAAAA,SAAS,CAACG,UAAU,CAACD,GAAG,CAAC,GAAGV,IAAI,CAACU,GAAG,CAAC,CAAE,CAAC,CAAA,CAAA;AAC1D,OAAA;AACF,KAAA;AACF,GAAA;
|
|
1
|
+
{"version":3,"file":"class-names.js","sources":["../../src/helpers/class-names.ts"],"sourcesContent":["import { helper } from '@ember/component/helper';\nimport { assert } from '@ember/debug';\n\n// Mappings registry\nimport cssMappings from '../utils/css-mappings/index.ts';\n\ninterface Options {\n [key: string]: unknown;\n size?: string | number | boolean | {};\n side?: string;\n paddingSize?: string;\n textAlign?: string;\n textStyle?: string;\n color?: string;\n verticalPosition?: string;\n horizontalPosition?: string;\n componentName?: keyof typeof cssMappings;\n textTransform?: string;\n display?: string;\n type?: string;\n gutterSize?: string;\n alignItems?: string;\n direction?: string;\n justifyContent?: string;\n columns?: number;\n grow?: number | string | boolean;\n iconSide?: string;\n flush?: string | boolean;\n borderSide?: string;\n position?: string;\n theme?: string;\n margin?: string;\n borderRadius?: string;\n backgroundColor?: string;\n resize?: string;\n addBase?: boolean;\n}\n\n/**\n * Joins a list of classes\n *\n * @param classes - List of classes that will be joined\n */\nexport function classNames(\n classNames: (string | undefined)[] = [],\n options: Options\n): string {\n let { componentName, ...rest } = options;\n let includeBase = options.addBase !== false;\n let str = `${classNames.join(' ')}`;\n\n if (options.componentName) {\n assert(\n `The component '${options.componentName}' doesn't have mappings defined`,\n cssMappings[options.componentName] !== undefined\n );\n\n const component = cssMappings[options.componentName]!;\n\n if (includeBase) {\n str = `${str} ${component.base}`;\n }\n\n for (let key in rest) {\n //@ts-expect-error\n if (component.properties[key] && component.properties[key]?.[rest[key]]) {\n //@ts-expect-error\n str = `${str} ${component.properties[key]?.[rest[key]]}`;\n }\n }\n }\n\n return str.replace(/\\s+/g, ' ').trim();\n}\n\nexport default helper<(string | undefined)[], Options, string>(classNames);\n"],"names":["classNames","options","componentName","rest","includeBase","addBase","str","join","assert","cssMappings","undefined","component","base","key","properties","replace","trim","helper"],"mappings":";;;;AAsCA;AACA;AACA;AACA;AACA;AACO,SAASA,UAAUA,CACxBA,UAAkC,GAAG,EAAE,EACvCC,OAAgB,EACR;EACR,IAAI;IAAEC,aAAa;IAAE,GAAGC,IAAAA;AAAK,GAAC,GAAGF,OAAO,CAAA;AACxC,EAAA,IAAIG,WAAW,GAAGH,OAAO,CAACI,OAAO,KAAK,KAAK,CAAA;EAC3C,IAAIC,GAAG,GAAI,CAAEN,EAAAA,UAAU,CAACO,IAAI,CAAC,GAAG,CAAE,CAAC,CAAA,CAAA;EAEnC,IAAIN,OAAO,CAACC,aAAa,EAAE;AACzBM,IAAAA,MAAM,CACH,CAAA,eAAA,EAAiBP,OAAO,CAACC,aAAc,CAAgC,+BAAA,CAAA,EACxEO,OAAW,CAACR,OAAO,CAACC,aAAa,CAAC,KAAKQ,SACzC,CAAC,CAAA;AAED,IAAA,MAAMC,SAAS,GAAGF,OAAW,CAACR,OAAO,CAACC,aAAa,CAAE,CAAA;AAErD,IAAA,IAAIE,WAAW,EAAE;AACfE,MAAAA,GAAG,GAAI,CAAEA,EAAAA,GAAI,IAAGK,SAAS,CAACC,IAAK,CAAC,CAAA,CAAA;AAClC,KAAA;AAEA,IAAA,KAAK,IAAIC,GAAG,IAAIV,IAAI,EAAE;AACpB;AACA,MAAA,IAAIQ,SAAS,CAACG,UAAU,CAACD,GAAG,CAAC,IAAIF,SAAS,CAACG,UAAU,CAACD,GAAG,CAAC,GAAGV,IAAI,CAACU,GAAG,CAAC,CAAC,EAAE;AACvE;AACAP,QAAAA,GAAG,GAAI,CAAEA,EAAAA,GAAI,CAAGK,CAAAA,EAAAA,SAAS,CAACG,UAAU,CAACD,GAAG,CAAC,GAAGV,IAAI,CAACU,GAAG,CAAC,CAAE,CAAC,CAAA,CAAA;AAC1D,OAAA;AACF,KAAA;AACF,GAAA;EAEA,OAAOP,GAAG,CAACS,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAACC,IAAI,EAAE,CAAA;AACxC,CAAA;AAEA,mBAAeC,MAAM,CAA0CjB,UAAU,CAAC;;;;"}
|
|
@@ -20,7 +20,7 @@ function inlineStyles(_, params) {
|
|
|
20
20
|
};
|
|
21
21
|
for (let property in finalProperties) {
|
|
22
22
|
if (property === 'background-image' && finalProperties[property] !== 'none') {
|
|
23
|
-
finalProperties[property] = `url(${finalProperties[property]})`;
|
|
23
|
+
finalProperties[property] = `url('${finalProperties[property]}')`;
|
|
24
24
|
} else {
|
|
25
25
|
finalProperties[property] = `${finalProperties[property]}`;
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-styles.js","sources":["../../src/helpers/inline-styles.ts"],"sourcesContent":["import { helper } from '@ember/component/helper';\nimport { assert } from '@ember/debug';\n\nimport cssMappings from '../utils/css-mappings/index.ts';\n\ninterface InlineStylesParams {\n componentName?: string;\n componentArgs?: Record<string, unknown>;\n [property: string]: unknown;\n}\n\nexport function inlineStyles(_: unknown, params: InlineStylesParams) {\n const { componentName, componentArgs = {}, ...properties } = params;\n let componentStyles = {};\n\n if (componentName) {\n assert(\n `Could not find component ${componentName} in cssMappings.`,\n cssMappings[componentName]\n );\n assert(\n `Could not find inlineStyles in ${componentName}'s cssMapping.`,\n cssMappings[componentName]?.inlineStyles\n );\n componentStyles =\n cssMappings[componentName]?.inlineStyles?.(componentArgs) || {};\n }\n\n let finalProperties: {\n [name: string]: string | undefined;\n } = {\n ...properties,\n ...componentStyles\n };\n\n for (let property in finalProperties) {\n if (\n property === 'background-image' &&\n finalProperties[property] !== 'none'\n ) {\n finalProperties[property] = `url(${finalProperties[property]})`;\n } else {\n finalProperties[property] = `${finalProperties[property]}`;\n }\n }\n\n return finalProperties;\n}\n\nexport default helper(inlineStyles);\n"],"names":["inlineStyles","_","params","componentName","componentArgs","properties","componentStyles","assert","cssMappings","finalProperties","property","helper"],"mappings":";;;;AAWO,SAASA,YAAYA,CAACC,CAAU,EAAEC,MAA0B,EAAE;EACnE,MAAM;IAAEC,aAAa;IAAEC,aAAa,GAAG,EAAE;IAAE,GAAGC,UAAAA;AAAW,GAAC,GAAGH,MAAM,CAAA;EACnE,IAAII,eAAe,GAAG,EAAE,CAAA;AAExB,EAAA,IAAIH,aAAa,EAAE;IACjBI,MAAM,CACH,4BAA2BJ,aAAc,CAAA,gBAAA,CAAiB,EAC3DK,OAAW,CAACL,aAAa,CAC3B,CAAC,CAAA;IACDI,MAAM,CACH,CAAiCJ,+BAAAA,EAAAA,aAAc,CAAe,cAAA,CAAA,EAC/DK,OAAW,CAACL,aAAa,CAAC,EAAEH,YAC9B,CAAC,CAAA;AACDM,IAAAA,eAAe,GACbE,OAAW,CAACL,aAAa,CAAC,EAAEH,YAAY,GAAGI,aAAa,CAAC,IAAI,EAAE,CAAA;AACnE,GAAA;AAEA,EAAA,IAAIK,eAEH,GAAG;AACF,IAAA,GAAGJ,UAAU;IACb,GAAGC,eAAAA;GACJ,CAAA;AAED,EAAA,KAAK,IAAII,QAAQ,IAAID,eAAe,EAAE;IACpC,IACEC,QAAQ,KAAK,kBAAkB,IAC/BD,eAAe,CAACC,QAAQ,CAAC,KAAK,MAAM,EACpC;MACAD,eAAe,CAACC,QAAQ,CAAC,GAAI,
|
|
1
|
+
{"version":3,"file":"inline-styles.js","sources":["../../src/helpers/inline-styles.ts"],"sourcesContent":["import { helper } from '@ember/component/helper';\nimport { assert } from '@ember/debug';\n\nimport cssMappings from '../utils/css-mappings/index.ts';\n\ninterface InlineStylesParams {\n componentName?: string;\n componentArgs?: Record<string, unknown>;\n [property: string]: unknown;\n}\n\nexport function inlineStyles(_: unknown, params: InlineStylesParams) {\n const { componentName, componentArgs = {}, ...properties } = params;\n let componentStyles = {};\n\n if (componentName) {\n assert(\n `Could not find component ${componentName} in cssMappings.`,\n cssMappings[componentName]\n );\n assert(\n `Could not find inlineStyles in ${componentName}'s cssMapping.`,\n cssMappings[componentName]?.inlineStyles\n );\n componentStyles =\n cssMappings[componentName]?.inlineStyles?.(componentArgs) || {};\n }\n\n let finalProperties: {\n [name: string]: string | undefined;\n } = {\n ...properties,\n ...componentStyles\n };\n\n for (let property in finalProperties) {\n if (\n property === 'background-image' &&\n finalProperties[property] !== 'none'\n ) {\n finalProperties[property] = `url('${finalProperties[property]}')`;\n } else {\n finalProperties[property] = `${finalProperties[property]}`;\n }\n }\n\n return finalProperties;\n}\n\nexport default helper(inlineStyles);\n"],"names":["inlineStyles","_","params","componentName","componentArgs","properties","componentStyles","assert","cssMappings","finalProperties","property","helper"],"mappings":";;;;AAWO,SAASA,YAAYA,CAACC,CAAU,EAAEC,MAA0B,EAAE;EACnE,MAAM;IAAEC,aAAa;IAAEC,aAAa,GAAG,EAAE;IAAE,GAAGC,UAAAA;AAAW,GAAC,GAAGH,MAAM,CAAA;EACnE,IAAII,eAAe,GAAG,EAAE,CAAA;AAExB,EAAA,IAAIH,aAAa,EAAE;IACjBI,MAAM,CACH,4BAA2BJ,aAAc,CAAA,gBAAA,CAAiB,EAC3DK,OAAW,CAACL,aAAa,CAC3B,CAAC,CAAA;IACDI,MAAM,CACH,CAAiCJ,+BAAAA,EAAAA,aAAc,CAAe,cAAA,CAAA,EAC/DK,OAAW,CAACL,aAAa,CAAC,EAAEH,YAC9B,CAAC,CAAA;AACDM,IAAAA,eAAe,GACbE,OAAW,CAACL,aAAa,CAAC,EAAEH,YAAY,GAAGI,aAAa,CAAC,IAAI,EAAE,CAAA;AACnE,GAAA;AAEA,EAAA,IAAIK,eAEH,GAAG;AACF,IAAA,GAAGJ,UAAU;IACb,GAAGC,eAAAA;GACJ,CAAA;AAED,EAAA,KAAK,IAAII,QAAQ,IAAID,eAAe,EAAE;IACpC,IACEC,QAAQ,KAAK,kBAAkB,IAC/BD,eAAe,CAACC,QAAQ,CAAC,KAAK,MAAM,EACpC;MACAD,eAAe,CAACC,QAAQ,CAAC,GAAI,QAAOD,eAAe,CAACC,QAAQ,CAAE,CAAG,EAAA,CAAA,CAAA;AACnE,KAAC,MAAM;MACLD,eAAe,CAACC,QAAQ,CAAC,GAAI,GAAED,eAAe,CAACC,QAAQ,CAAE,CAAC,CAAA,CAAA;AAC5D,KAAA;AACF,GAAA;AAEA,EAAA,OAAOD,eAAe,CAAA;AACxB,CAAA;AAEA,qBAAeE,MAAM,CAACX,YAAY,CAAC;;;;"}
|
|
@@ -28,7 +28,7 @@ function inlineStyles({
|
|
|
28
28
|
checkValidInitials(initials);
|
|
29
29
|
const isNamedColor = color === 'plain' || color === null;
|
|
30
30
|
if (imageUrl) {
|
|
31
|
-
avatarStyle.backgroundImage = `url(${imageUrl})`;
|
|
31
|
+
avatarStyle.backgroundImage = `url('${imageUrl}')`;
|
|
32
32
|
} else {
|
|
33
33
|
avatarStyle.backgroundImage = 'none';
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-avatar.js","sources":["../../../src/utils/css-mappings/eui-avatar.ts"],"sourcesContent":["import { assert, warn } from '@ember/debug';\n\nimport { hexToRgb } from '../../helpers/hex-to-rgb.ts';\nimport { isColorDark } from '../../helpers/is-color-dark.ts';\nimport { isValidHex } from '../../helpers/is-valid-hex.ts';\nimport { euiPaletteColorBlindBehindText } from '../../utils/color/eui_palettes.ts';\n\nexport const baseClass = 'euiAvatar';\nexport const VIS_COLORS = euiPaletteColorBlindBehindText();\n\nexport const sizeMapping = {\n s: `${baseClass}--s`,\n m: `${baseClass}--m`,\n l: `${baseClass}--l`,\n xl: `${baseClass}--xl`\n};\n\nexport const typeMapping = {\n space: `${baseClass}--space`,\n user: `${baseClass}--user`\n};\n\nexport function inlineStyles({\n name,\n color,\n imageUrl,\n initials\n}: {\n name: string;\n color: string;\n iconColor: string;\n imageUrl?: string;\n initials?: string;\n}): Styling {\n let assignedColor = color;\n // let iconCustomColor = iconColor;\n let avatarStyle: {\n backgroundColor?: string;\n color?: string;\n backgroundImage?: string;\n } = {};\n\n checkValidInitials(initials);\n\n const isNamedColor = color === 'plain' || color === null;\n\n if (imageUrl) {\n avatarStyle.backgroundImage = `url(${imageUrl})`;\n } else {\n avatarStyle.backgroundImage = 'none';\n }\n\n if (!isNamedColor) {\n checkValidColor(color);\n\n name = name ? name : '';\n assignedColor = (color ||\n VIS_COLORS[Math.floor(name.length % VIS_COLORS.length)]) as string;\n\n const textColor = isColorDark(...hexToRgb(assignedColor || 'base'))\n ? '#FFFFFF'\n : '#000000';\n\n avatarStyle.backgroundColor = assignedColor;\n avatarStyle.color = textColor;\n\n return avatarStyle;\n }\n\n return avatarStyle;\n}\n\nexport const checkValidColor = (color: string | 'plain' | null) => {\n const validHex = (color && isValidHex(color)) || color === 'plain';\n\n if (color && !validHex) {\n assert(\n 'EuiAvatar needs to pass a valid color. This can either be a three or six character hex value',\n true\n );\n }\n};\n\nfunction checkValidInitials(initials?: string) {\n // Must be a string of 1 or 2 characters\n if (initials && initials.length > 2) {\n warn(\n 'EuiAvatar only accepts a max of 2 characters for the initials as a string. It is displaying only the first 2 characters.',\n {\n id: 'EuiAvatar-initials-excedeed'\n }\n );\n }\n}\n\nconst mapping: ComponentMapping = {\n base: baseClass,\n properties: {\n size: sizeMapping,\n type: typeMapping\n },\n inlineStyles: inlineStyles\n};\n\nexport default mapping;\n"],"names":["baseClass","VIS_COLORS","euiPaletteColorBlindBehindText","sizeMapping","s","m","l","xl","typeMapping","space","user","inlineStyles","name","color","imageUrl","initials","assignedColor","avatarStyle","checkValidInitials","isNamedColor","backgroundImage","checkValidColor","Math","floor","length","textColor","isColorDark","hexToRgb","backgroundColor","validHex","isValidHex","assert","warn","id","mapping","base","properties","size","type"],"mappings":";;;;;;AAOO,MAAMA,SAAS,GAAG,YAAW;AACvBC,MAAAA,UAAU,GAAGC,8BAA8B,GAAE;AAEnD,MAAMC,WAAW,GAAG;EACzBC,CAAC,EAAG,CAAEJ,EAAAA,SAAU,CAAI,GAAA,CAAA;EACpBK,CAAC,EAAG,CAAEL,EAAAA,SAAU,CAAI,GAAA,CAAA;EACpBM,CAAC,EAAG,CAAEN,EAAAA,SAAU,CAAI,GAAA,CAAA;EACpBO,EAAE,EAAG,GAAEP,SAAU,CAAA,IAAA,CAAA;AACnB,EAAC;AAEM,MAAMQ,WAAW,GAAG;EACzBC,KAAK,EAAG,CAAET,EAAAA,SAAU,CAAQ,OAAA,CAAA;EAC5BU,IAAI,EAAG,GAAEV,SAAU,CAAA,MAAA,CAAA;AACrB,EAAC;AAEM,SAASW,YAAYA,CAAC;EAC3BC,IAAI;EACJC,KAAK;EACLC,QAAQ;AACRC,EAAAA,QAAAA;AAOF,CAAC,EAAW;EACV,IAAIC,aAAa,GAAGH,KAAK,CAAA;AACzB;EACA,IAAII,WAIH,GAAG,EAAE,CAAA;EAENC,kBAAkB,CAACH,QAAQ,CAAC,CAAA;EAE5B,MAAMI,YAAY,GAAGN,KAAK,KAAK,OAAO,IAAIA,KAAK,KAAK,IAAI,CAAA;AAExD,EAAA,IAAIC,QAAQ,EAAE;AACZG,IAAAA,WAAW,CAACG,eAAe,GAAI,CAAA,
|
|
1
|
+
{"version":3,"file":"eui-avatar.js","sources":["../../../src/utils/css-mappings/eui-avatar.ts"],"sourcesContent":["import { assert, warn } from '@ember/debug';\n\nimport { hexToRgb } from '../../helpers/hex-to-rgb.ts';\nimport { isColorDark } from '../../helpers/is-color-dark.ts';\nimport { isValidHex } from '../../helpers/is-valid-hex.ts';\nimport { euiPaletteColorBlindBehindText } from '../../utils/color/eui_palettes.ts';\n\nexport const baseClass = 'euiAvatar';\nexport const VIS_COLORS = euiPaletteColorBlindBehindText();\n\nexport const sizeMapping = {\n s: `${baseClass}--s`,\n m: `${baseClass}--m`,\n l: `${baseClass}--l`,\n xl: `${baseClass}--xl`\n};\n\nexport const typeMapping = {\n space: `${baseClass}--space`,\n user: `${baseClass}--user`\n};\n\nexport function inlineStyles({\n name,\n color,\n imageUrl,\n initials\n}: {\n name: string;\n color: string;\n iconColor: string;\n imageUrl?: string;\n initials?: string;\n}): Styling {\n let assignedColor = color;\n // let iconCustomColor = iconColor;\n let avatarStyle: {\n backgroundColor?: string;\n color?: string;\n backgroundImage?: string;\n } = {};\n\n checkValidInitials(initials);\n\n const isNamedColor = color === 'plain' || color === null;\n\n if (imageUrl) {\n avatarStyle.backgroundImage = `url('${imageUrl}')`;\n } else {\n avatarStyle.backgroundImage = 'none';\n }\n\n if (!isNamedColor) {\n checkValidColor(color);\n\n name = name ? name : '';\n assignedColor = (color ||\n VIS_COLORS[Math.floor(name.length % VIS_COLORS.length)]) as string;\n\n const textColor = isColorDark(...hexToRgb(assignedColor || 'base'))\n ? '#FFFFFF'\n : '#000000';\n\n avatarStyle.backgroundColor = assignedColor;\n avatarStyle.color = textColor;\n\n return avatarStyle;\n }\n\n return avatarStyle;\n}\n\nexport const checkValidColor = (color: string | 'plain' | null) => {\n const validHex = (color && isValidHex(color)) || color === 'plain';\n\n if (color && !validHex) {\n assert(\n 'EuiAvatar needs to pass a valid color. This can either be a three or six character hex value',\n true\n );\n }\n};\n\nfunction checkValidInitials(initials?: string) {\n // Must be a string of 1 or 2 characters\n if (initials && initials.length > 2) {\n warn(\n 'EuiAvatar only accepts a max of 2 characters for the initials as a string. It is displaying only the first 2 characters.',\n {\n id: 'EuiAvatar-initials-excedeed'\n }\n );\n }\n}\n\nconst mapping: ComponentMapping = {\n base: baseClass,\n properties: {\n size: sizeMapping,\n type: typeMapping\n },\n inlineStyles: inlineStyles\n};\n\nexport default mapping;\n"],"names":["baseClass","VIS_COLORS","euiPaletteColorBlindBehindText","sizeMapping","s","m","l","xl","typeMapping","space","user","inlineStyles","name","color","imageUrl","initials","assignedColor","avatarStyle","checkValidInitials","isNamedColor","backgroundImage","checkValidColor","Math","floor","length","textColor","isColorDark","hexToRgb","backgroundColor","validHex","isValidHex","assert","warn","id","mapping","base","properties","size","type"],"mappings":";;;;;;AAOO,MAAMA,SAAS,GAAG,YAAW;AACvBC,MAAAA,UAAU,GAAGC,8BAA8B,GAAE;AAEnD,MAAMC,WAAW,GAAG;EACzBC,CAAC,EAAG,CAAEJ,EAAAA,SAAU,CAAI,GAAA,CAAA;EACpBK,CAAC,EAAG,CAAEL,EAAAA,SAAU,CAAI,GAAA,CAAA;EACpBM,CAAC,EAAG,CAAEN,EAAAA,SAAU,CAAI,GAAA,CAAA;EACpBO,EAAE,EAAG,GAAEP,SAAU,CAAA,IAAA,CAAA;AACnB,EAAC;AAEM,MAAMQ,WAAW,GAAG;EACzBC,KAAK,EAAG,CAAET,EAAAA,SAAU,CAAQ,OAAA,CAAA;EAC5BU,IAAI,EAAG,GAAEV,SAAU,CAAA,MAAA,CAAA;AACrB,EAAC;AAEM,SAASW,YAAYA,CAAC;EAC3BC,IAAI;EACJC,KAAK;EACLC,QAAQ;AACRC,EAAAA,QAAAA;AAOF,CAAC,EAAW;EACV,IAAIC,aAAa,GAAGH,KAAK,CAAA;AACzB;EACA,IAAII,WAIH,GAAG,EAAE,CAAA;EAENC,kBAAkB,CAACH,QAAQ,CAAC,CAAA;EAE5B,MAAMI,YAAY,GAAGN,KAAK,KAAK,OAAO,IAAIA,KAAK,KAAK,IAAI,CAAA;AAExD,EAAA,IAAIC,QAAQ,EAAE;AACZG,IAAAA,WAAW,CAACG,eAAe,GAAI,CAAA,KAAA,EAAON,QAAS,CAAG,EAAA,CAAA,CAAA;AACpD,GAAC,MAAM;IACLG,WAAW,CAACG,eAAe,GAAG,MAAM,CAAA;AACtC,GAAA;EAEA,IAAI,CAACD,YAAY,EAAE;IACjBE,eAAe,CAACR,KAAK,CAAC,CAAA;AAEtBD,IAAAA,IAAI,GAAGA,IAAI,GAAGA,IAAI,GAAG,EAAE,CAAA;AACvBI,IAAAA,aAAa,GAAIH,KAAK,IACpBZ,UAAU,CAACqB,IAAI,CAACC,KAAK,CAACX,IAAI,CAACY,MAAM,GAAGvB,UAAU,CAACuB,MAAM,CAAC,CAAY,CAAA;AAEpE,IAAA,MAAMC,SAAS,GAAGC,WAAW,CAAC,GAAGC,QAAQ,CAACX,aAAa,IAAI,MAAM,CAAC,CAAC,GAC/D,SAAS,GACT,SAAS,CAAA;IAEbC,WAAW,CAACW,eAAe,GAAGZ,aAAa,CAAA;IAC3CC,WAAW,CAACJ,KAAK,GAAGY,SAAS,CAAA;AAE7B,IAAA,OAAOR,WAAW,CAAA;AACpB,GAAA;AAEA,EAAA,OAAOA,WAAW,CAAA;AACpB,CAAA;AAEaI,MAAAA,eAAe,GAAIR,KAA8B,IAAK;EACjE,MAAMgB,QAAQ,GAAIhB,KAAK,IAAIiB,UAAU,CAACjB,KAAK,CAAC,IAAKA,KAAK,KAAK,OAAO,CAAA;AAElE,EAAA,IAAIA,KAAK,IAAI,CAACgB,QAAQ,EAAE;AACtBE,IAAAA,MAAM,CACJ,8FAA8F,EAC9F,IACF,CAAC,CAAA;AACH,GAAA;AACF,EAAC;AAED,SAASb,kBAAkBA,CAACH,QAAiB,EAAE;AAC7C;AACA,EAAA,IAAIA,QAAQ,IAAIA,QAAQ,CAACS,MAAM,GAAG,CAAC,EAAE;IACnCQ,IAAI,CACF,0HAA0H,EAC1H;AACEC,MAAAA,EAAE,EAAE,6BAAA;AACN,KACF,CAAC,CAAA;AACH,GAAA;AACF,CAAA;AAEA,MAAMC,OAAyB,GAAG;AAChCC,EAAAA,IAAI,EAAEnC,SAAS;AACfoC,EAAAA,UAAU,EAAE;AACVC,IAAAA,IAAI,EAAElC,WAAW;AACjBmC,IAAAA,IAAI,EAAE9B,WAAAA;GACP;AACDG,EAAAA,YAAY,EAAEA,YAAAA;AAChB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-eui/core",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.7",
|
|
4
4
|
"description": "Ember Components for Elastic UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -408,7 +408,6 @@
|
|
|
408
408
|
"./helpers/type-of.js": "./dist/_app_/helpers/type-of.js",
|
|
409
409
|
"./helpers/use-state.js": "./dist/_app_/helpers/use-state.js",
|
|
410
410
|
"./modifiers/mutation-observer.js": "./dist/_app_/modifiers/mutation-observer.js",
|
|
411
|
-
"./modifiers/open-collapsible-nav.js": "./dist/_app_/modifiers/open-collapsible-nav.js",
|
|
412
411
|
"./modifiers/outside-click-detector.js": "./dist/_app_/modifiers/outside-click-detector.js",
|
|
413
412
|
"./modifiers/resize-observer.js": "./dist/_app_/modifiers/resize-observer.js",
|
|
414
413
|
"./modifiers/screen-reader-only.js": "./dist/_app_/modifiers/screen-reader-only.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "@ember-eui/core/modifiers/open-collapsible-nav";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { modifier } from 'ember-modifier';
|
|
2
|
-
|
|
3
|
-
let counter = 0;
|
|
4
|
-
var openCollapsibleNav = modifier(function openCollapsibleNav(_, [navIsDocked]) {
|
|
5
|
-
counter++;
|
|
6
|
-
if (navIsDocked) {
|
|
7
|
-
document.body.classList.add('euiBody--collapsibleNavIsDocked');
|
|
8
|
-
}
|
|
9
|
-
document.body.classList.add('euiBody--collapsibleNavIsOpen');
|
|
10
|
-
return () => {
|
|
11
|
-
counter--;
|
|
12
|
-
if (!counter) {
|
|
13
|
-
if (navIsDocked) {
|
|
14
|
-
document.body.classList.remove('euiBody--collapsibleNavIsDocked');
|
|
15
|
-
}
|
|
16
|
-
document.body.classList.remove('euiBody--collapsibleNavIsOpen');
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export { openCollapsibleNav as default };
|
|
22
|
-
//# sourceMappingURL=open-collapsible-nav.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"open-collapsible-nav.js","sources":["../../src/modifiers/open-collapsible-nav.ts"],"sourcesContent":["import { modifier } from 'ember-modifier';\n\nlet counter = 0;\n\nexport default modifier(function openCollapsibleNav(\n _,\n [navIsDocked]: [boolean]\n) {\n counter++;\n\n if (navIsDocked) {\n document.body.classList.add('euiBody--collapsibleNavIsDocked');\n }\n\n document.body.classList.add('euiBody--collapsibleNavIsOpen');\n\n return (): void => {\n counter--;\n\n if (!counter) {\n if (navIsDocked) {\n document.body.classList.remove('euiBody--collapsibleNavIsDocked');\n }\n\n document.body.classList.remove('euiBody--collapsibleNavIsOpen');\n }\n };\n});\n"],"names":["counter","modifier","openCollapsibleNav","_","navIsDocked","document","body","classList","add","remove"],"mappings":";;AAEA,IAAIA,OAAO,GAAG,CAAC,CAAA;AAEf,yBAAeC,QAAQ,CAAC,SAASC,kBAAkBA,CACjDC,CAAC,EACD,CAACC,WAAW,CAAY,EACxB;AACAJ,EAAAA,OAAO,EAAE,CAAA;AAET,EAAA,IAAII,WAAW,EAAE;IACfC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACC,GAAG,CAAC,iCAAiC,CAAC,CAAA;AAChE,GAAA;EAEAH,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACC,GAAG,CAAC,+BAA+B,CAAC,CAAA;AAE5D,EAAA,OAAO,MAAY;AACjBR,IAAAA,OAAO,EAAE,CAAA;IAET,IAAI,CAACA,OAAO,EAAE;AACZ,MAAA,IAAII,WAAW,EAAE;QACfC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAC,iCAAiC,CAAC,CAAA;AACnE,OAAA;MAEAJ,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAC,+BAA+B,CAAC,CAAA;AACjE,KAAA;GACD,CAAA;AACH,CAAC,CAAC;;;;"}
|