@rededor/cura 1.0.0-alpha.1 → 1.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cura-accordion_9.cjs.entry.js +4 -4
- package/dist/cjs/cura-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/cura-display.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +16 -8
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-dropdown-search.cjs.entry.js +19 -11
- package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-loader-bar.cjs.entry.js +46 -0
- package/dist/cjs/cura-loader-bar.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-radio.cjs.entry.js +1 -1
- package/dist/cjs/cura-select_2.cjs.entry.js +4 -4
- package/dist/cjs/cura-switch.cjs.entry.js +1 -1
- package/dist/cjs/cura-toast.cjs.entry.js +106 -0
- package/dist/cjs/cura-toast.cjs.entry.js.map +1 -0
- package/dist/cjs/cura.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/cura-toast/cura-toast.css +161 -0
- package/dist/collection/components/cura-toast/cura-toast.js +261 -0
- package/dist/collection/components/cura-toast/cura-toast.js.map +1 -0
- package/dist/collection/components/cura-toast/cura-toast.stories.js +149 -0
- package/dist/collection/components/cura-toast/cura-toast.stories.js.map +1 -0
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.css +4 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +33 -7
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js.map +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js +10 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.css +2 -2
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +36 -10
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js +15 -3
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-label/cura-label.js +1 -1
- package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.js +3 -3
- package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
- package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
- package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.css +21 -0
- package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +95 -0
- package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js.map +1 -0
- package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.stories.js +54 -0
- package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.stories.js.map +1 -0
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
- package/dist/collection/components/text/cura-display/cura-display.js +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
- package/dist/components/cura-checkbox.js +1 -1
- package/dist/components/cura-display.js +1 -1
- package/dist/components/cura-dropdown-search-option-title.js +1 -1
- package/dist/components/cura-dropdown-search-option.js +17 -8
- package/dist/components/cura-dropdown-search-option.js.map +1 -1
- package/dist/components/cura-dropdown-search.js +20 -11
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/cura-heading2.js +1 -1
- package/dist/components/cura-label2.js +1 -1
- package/dist/components/cura-loader-bar.d.ts +11 -0
- package/dist/components/cura-loader-bar.js +8 -0
- package/dist/components/cura-loader-bar.js.map +1 -0
- package/dist/components/cura-loader-bar2.js +64 -0
- package/dist/components/cura-loader-bar2.js.map +1 -0
- package/dist/components/cura-loader-circle2.js +1 -1
- package/dist/components/cura-paragraph2.js +1 -1
- package/dist/components/cura-radio.js +1 -1
- package/dist/components/cura-select-option2.js +1 -1
- package/dist/components/cura-select2.js +3 -3
- package/dist/components/cura-switch.js +1 -1
- package/dist/components/cura-toast.d.ts +11 -0
- package/dist/components/cura-toast.js +157 -0
- package/dist/components/cura-toast.js.map +1 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/p-039b3701.entry.js +2 -0
- package/dist/cura/p-039b3701.entry.js.map +1 -0
- package/dist/cura/p-29790bb5.entry.js +2 -0
- package/dist/cura/p-29790bb5.entry.js.map +1 -0
- package/dist/cura/{p-93389727.entry.js → p-45bc4f7c.entry.js} +2 -2
- package/dist/cura/p-4eaeb590.entry.js +2 -0
- package/dist/cura/p-4eaeb590.entry.js.map +1 -0
- package/dist/cura/{p-ba2e7222.entry.js → p-5fcfbf32.entry.js} +2 -2
- package/dist/cura/{p-3c39a9d8.entry.js → p-67e34464.entry.js} +2 -2
- package/dist/cura/{p-5466758a.entry.js → p-8433fec9.entry.js} +2 -2
- package/dist/cura/p-a5e53dd4.entry.js +2 -0
- package/dist/cura/{p-ced36448.entry.js.map → p-a5e53dd4.entry.js.map} +1 -1
- package/dist/cura/{p-578c74a4.entry.js → p-a9dad622.entry.js} +2 -2
- package/dist/cura/p-af2036a7.entry.js +2 -0
- package/dist/cura/p-b1148bb2.entry.js +2 -0
- package/dist/cura/p-b1148bb2.entry.js.map +1 -0
- package/dist/esm/cura-accordion_9.entry.js +4 -4
- package/dist/esm/cura-checkbox.entry.js +1 -1
- package/dist/esm/cura-display.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-option-title.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-option.entry.js +16 -8
- package/dist/esm/cura-dropdown-search-option.entry.js.map +1 -1
- package/dist/esm/cura-dropdown-search.entry.js +19 -11
- package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
- package/dist/esm/cura-loader-bar.entry.js +42 -0
- package/dist/esm/cura-loader-bar.entry.js.map +1 -0
- package/dist/esm/cura-radio.entry.js +1 -1
- package/dist/esm/cura-select_2.entry.js +4 -4
- package/dist/esm/cura-switch.entry.js +1 -1
- package/dist/esm/cura-toast.entry.js +102 -0
- package/dist/esm/cura-toast.entry.js.map +1 -0
- package/dist/esm/cura.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cura-toast/cura-toast.d.ts +26 -0
- package/dist/types/components/cura-toast/cura-toast.stories.d.ts +119 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.d.ts +4 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.stories.d.ts +11 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +8 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.stories.d.ts +21 -2
- package/dist/types/components/loaders/cura-loader-bar/cura-loader-bar.d.ts +12 -0
- package/dist/types/components/loaders/cura-loader-bar/cura-loader-bar.stories.d.ts +39 -0
- package/dist/types/components.d.ts +76 -0
- package/package.json +2 -2
- package/dist/cura/p-251bd980.entry.js +0 -2
- package/dist/cura/p-251bd980.entry.js.map +0 -1
- package/dist/cura/p-61d20270.entry.js +0 -2
- package/dist/cura/p-b3a50bcf.entry.js +0 -2
- package/dist/cura/p-b3a50bcf.entry.js.map +0 -1
- package/dist/cura/p-ced36448.entry.js +0 -2
- /package/dist/cura/{p-93389727.entry.js.map → p-45bc4f7c.entry.js.map} +0 -0
- /package/dist/cura/{p-ba2e7222.entry.js.map → p-5fcfbf32.entry.js.map} +0 -0
- /package/dist/cura/{p-3c39a9d8.entry.js.map → p-67e34464.entry.js.map} +0 -0
- /package/dist/cura/{p-5466758a.entry.js.map → p-8433fec9.entry.js.map} +0 -0
- /package/dist/cura/{p-578c74a4.entry.js.map → p-a9dad622.entry.js.map} +0 -0
- /package/dist/cura/{p-61d20270.entry.js.map → p-af2036a7.entry.js.map} +0 -0
package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-dropdown-search.stories.js","sourceRoot":"","sources":["../../../../src/components/forms/cura-dropdown-search/cura-dropdown-search.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEnE,MAAM,YAAY,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;AACjD,MAAM,wBAAwB,GAAG,CAAC,IAAS,EAAE,EAAE;IAC7C,OAAO;;cAEK,IAAI,CAAC,MAAM;YACb,IAAI,CAAC,IAAI;iBACJ,IAAI,CAAC,QAAQ;gBACd,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,QAAQ;aAChB,IAAI,CAAC,KAAK;mBACJ,IAAI,CAAC,WAAW;aACtB,IAAI,CAAC,KAAK;MACjB,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,2BAA2B,IAAI,CAAC,UAAU,SAAS,CAAC,CAAC,CAAC,EAAE;;MAE1E,IAAI,CAAC,OAAO;SACX,GAAG,CACF,MAAM,CAAC,EAAE,CAAC,uCAAuC,MAAM,CAAC,KAAK;MAC/D,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,uBAAuB,MAAM,CAAC,KAAK,QAAQ,CAAC,C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AAK,EAAE,kDAAkD;gBACzD,OAAO,EAAE,sBAAsB;gBAC/B,MAAM,EAAE,wIAAwI;aACjJ;YACD;gBACE,KAAK,EAAE,uBAAuB;gBAC9B,KAAK,EAAE,mDAAmD;gBAC1D,OAAO,EAAE;mHACkG;gBAC3G,MAAM,EAAE,EAAE;aACX;YACD;gBACE,KAAK,EAAE,iCAAiC;gBACxC,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;OAsBR;gBACC,OAAO,EAAE;;;;;iBAKA;gBACT,MAAM,EAAE,EAAE;aACX;SACF;KACF;CACF,CAAC","sourcesContent":["import iconNames from '../../../assets/icons/iconset-default-list';\n\nconst storybookUrl = `${window.location.origin}`;\nconst renderCuraDropdownSearch = (args: any) => {\n return `<cura-dropdown-search\n style=\"height: 400px;\"\n status=\"${args.status}\"\n name=\"${args.name}\"\n icon-name=\"${args.iconName}\"\n required=\"${args.required}\"\n selected=\"${args.selected}\"\n value=\"${args.value}\"\n placeholder=\"${args.placeholder}\"\n label=\"${args.label}\">\n ${args.helperText ? `<span slot=\"helperText\">${args.helperText}</span>` : ''}\n <cura-dropdown-search-option-title>Mais Buscados</cura-dropdown-search-option-title>\n ${args.options\n .map(\n option => `<cura-dropdown-search-option value=\"${option.value}\">\n ${option.image ? ` <div slot=\"image\">${option.image}</div>` : ''}\n ${option.content}\n ${\n option.action\n ? ` <div slot=\"action\">\n ${option.action}\n </div>`\n : ''\n }\n </cura-dropdown-search-option>\n `,\n )\n .join('')}\n </cura-dropdown-search>`;\n};\n\nexport default {\n title: 'Componentes/DropdownSearch/DropDownSearch',\n tags: ['autodocs'],\n parameters: {\n docs: {\n description: {\n component: `<cura-paragraph size=\"small\">\n\n O \\`cura-dropdown-search\\` é um componente para busca rápida entre opções, com suporte a ícones, avatares, e ações customizáveis. Ele é responsivo e seu layout é ajustado dependendo do tamanho da tela.\n <br/><br/>\n\n Em dispositivos móveis, o componente abre em modo full-screen, facilitando a navegação e seleção de opções. Você pode visualizar esse comportamento abrindo o story dele\n [aqui](${storybookUrl}/?path=/story/componentes-dropdownsearch-dropdownsearch--dropdown-search) e ajustando o tamanho da sua tela.\n\n </cura-paragraph>`,\n },\n },\n },\n render: args => {\n return renderCuraDropdownSearch(args);\n },\n argTypes: {\n status: {\n control: { type: 'inline-radio' },\n options: ['default', 'error'],\n description: 'Status do dropdown.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'default' },\n },\n },\n name: {\n control: 'text',\n description: 'Nome do dropdown.',\n required: false,\n table: {\n category: 'Properties',\n },\n },\n iconName: {\n control: { type: 'select' },\n options: ['', ...iconNames],\n description: 'Nome do ícone no iconset a ser utilizado.',\n table: {\n category: 'Icons'\n },\n name: 'icon-name'\n },\n required: {\n control: 'boolean',\n description: 'Define se o campo é obrigatório.',\n table: {\n category: 'Properties',\n defaultValue: { summary: false },\n },\n },\n value: {\n control: 'text',\n description: 'Valor atual do campo de busca.',\n table: {\n category: 'Properties',\n },\n },\n placeholder: {\n control: 'text',\n description: 'Texto do placeholder.',\n required: false,\n table: {\n category: 'Properties',\n },\n },\n label: {\n control: 'text',\n description: 'Texto da label do input.',\n required: false,\n table: {\n category: 'Properties',\n },\n },\n helperText: {\n control: 'text',\n description: 'Texto de ajuda para o dropdown.',\n table: {\n category: 'Slots',\n },\n },\n oninput: {\n control: 'none',\n description: 'Evento via Listener quando o estado do value do dropdown é alterado',\n table: {\n category: 'Events',\n },\n },\n options: {\n control: { type: 'object' },\n description: 'Um slot name=dropdown-search-option para herdar as opções do dropdown. Pensado para usar o componente `<cura-dropdown-search-option>`',\n table: {\n category: 'Slots',\n defaultValue: { summary: [] },\n },\n },\n },\n};\n\nexport const DropdownSearch = {\n args: {\n status: 'default',\n name: 'cura-dropdown',\n iconName: '',\n required: false,\n value: '',\n placeholder: 'Faça a sua busca',\n label: 'Busca',\n helperText: 'Digite o que você deseja buscar.',\n options: [\n {\n value: 'Clinica Médica Geral',\n image: '<cura-icon size=\"24\" name=\"medical\"></cura-icon>',\n content: 'Clinica Médica Geral',\n action: `<cura-button-transparent font-color=\"dark\" color='primary' icon-name='delete' size='small' icon-only={true}></cura-button-transparent>`,\n },\n {\n value: 'Dora Martins de Souza',\n image: '<cura-avatar size=\"32\" imageSrc=\"\"></cura-avatar>',\n content: `Dora Martins de Souza\n <cura-paragraph color=\"neutral-dark\" margin-block=\"0\" size=\"xsmall\">Ortopedista Cirúrgico</cura-paragraph>`,\n action: '',\n },\n {\n value: 'Copa D’Or - Centro Cardiológico',\n image: `\n <div slot=\"image\">\n <div\n style=\"\n display: flex;\n align-content: center;\n align-items: center;\n justify-content: center;\n text-align: center;\n letter-spacing: 0.72px;\n width: 32px;\n height: 32px;\n border-radius: 4px;\n background-color: #E9E9E9;\n \"\n >\n <cura-label size=\"xsmall\" margin-block=\"0\" lineHeight=\"0\" color=\"neutral-black\" weight=\"bold\">\n 1 <br />\n KM\n </cura-label>\n </div>\n </div>\n `,\n content: `<div style=\"line-height='0';\">\n Copa D’Or - Centro Cardiológico\n <cura-paragraph color=\"neutral-dark\" margin-block=\"0\" size=\"xsmall\">\n Rua Siqueira Campos, 93 Copacabana, Rio de Janeiro\n </cura-paragraph>\n </div>`,\n action: '',\n },\n ],\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"cura-dropdown-search.stories.js","sourceRoot":"","sources":["../../../../src/components/forms/cura-dropdown-search/cura-dropdown-search.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,4CAA4C,CAAC;AAEnE,MAAM,YAAY,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;AACjD,MAAM,wBAAwB,GAAG,CAAC,IAAS,EAAE,EAAE;IAC7C,OAAO;;cAEK,IAAI,CAAC,MAAM;YACb,IAAI,CAAC,IAAI;iBACJ,IAAI,CAAC,QAAQ;gBACd,IAAI,CAAC,QAAQ;gBACb,IAAI,CAAC,QAAQ;aAChB,IAAI,CAAC,KAAK;mBACJ,IAAI,CAAC,WAAW;aACtB,IAAI,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EAAE,iCAAiC;YAC9C,KAAK,EAAE;gBACL,QAAQ,EAAE,OAAO;aAClB;SACF;QACD,OAAO,EAAE;YACP,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,qEAAqE;YAClF,KAAK,EAAE;gBACL,QAAQ,EAAE,QAAQ;aACnB;SACF;QACD,OAAO,EAAE;YACP,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,WAAW,EAAE,uIAAuI;YACpJ,KAAK,EAAE;gBACL,QAAQ,EAAE,OAAO;gBACjB,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;aAC9B;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,EAAE;QACT,WAAW,EAAE,kBAAkB;QAC/B,KAAK,EAAE,OAAO;QACd,iBAAiB,EAAE,OAAO;QAC1B,UAAU,EAAE,kCAAkC;QAC9C,OAAO,EAAE;YACP;gBACE,KAAK,EAAE,sBAAsB;gBAC7B,KAAK,EAAE,kDAAkD;gBACzD,OAAO,EAAE,sBAAsB;gBAC/B,MAAM,EAAE,wIAAwI;aACjJ;YACD;gBACE,KAAK,EAAE,uBAAuB;gBAC9B,KAAK,EAAE,mDAAmD;gBAC1D,OAAO,EAAE;mHACkG;gBAC3G,MAAM,EAAE,EAAE;gBACV,UAAU,EAAE,KAAK;aAClB;YACD;gBACE,KAAK,EAAE,iCAAiC;gBACxC,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;OAsBR;gBACC,OAAO,EAAE;;;;;iBAKA;gBACT,MAAM,EAAE,EAAE;aACX;SACF;KACF;CACF,CAAC","sourcesContent":["import iconNames from '../../../assets/icons/iconset-default-list';\n\nconst storybookUrl = `${window.location.origin}`;\nconst renderCuraDropdownSearch = (args: any) => {\n return `<cura-dropdown-search\n style=\"height: 400px;\"\n status=\"${args.status}\"\n name=\"${args.name}\"\n icon-name=\"${args.iconName}\"\n required=\"${args.required}\"\n selected=\"${args.selected}\"\n value=\"${args.value}\"\n placeholder=\"${args.placeholder}\"\n label=\"${args.label}\"${args.dropdownMaxHeight && args.dropdownMaxHeight !== '630px' ? `\n dropdown-max-height=\"${args.dropdownMaxHeight}\"` : ''}>\n ${args.helperText ? `<span slot=\"helperText\">${args.helperText}</span>` : ''}\n <cura-dropdown-search-option-title>Mais Buscados</cura-dropdown-search-option-title>\n ${args.options\n .map(\n option => `<cura-dropdown-search-option value=\"${option.value}\"${option.selectable === false ? ` selectable=\"false\"` : ''}>\n ${option.image ? ` <div slot=\"image\">${option.image}</div>` : ''}\n ${option.content}\n ${\n option.action\n ? ` <div slot=\"action\">\n ${option.action}\n </div>`\n : ''\n }\n </cura-dropdown-search-option>\n `,\n )\n .join('')}\n </cura-dropdown-search>`;\n};\n\nexport default {\n title: 'Componentes/DropdownSearch/DropDownSearch',\n tags: ['autodocs'],\n parameters: {\n docs: {\n description: {\n component: `<cura-paragraph size=\"small\">\n\n O \\`cura-dropdown-search\\` é um componente para busca rápida entre opções, com suporte a ícones, avatares, e ações customizáveis. Ele é responsivo e seu layout é ajustado dependendo do tamanho da tela.\n <br/><br/>\n\n Em dispositivos móveis, o componente abre em modo full-screen, facilitando a navegação e seleção de opções. Você pode visualizar esse comportamento abrindo o story dele\n [aqui](${storybookUrl}/?path=/story/componentes-dropdownsearch-dropdownsearch--dropdown-search) e ajustando o tamanho da sua tela.\n\n </cura-paragraph>`,\n },\n },\n },\n render: args => {\n return renderCuraDropdownSearch(args);\n },\n argTypes: {\n status: {\n control: { type: 'inline-radio' },\n options: ['default', 'error'],\n description: 'Status do dropdown.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'default' },\n },\n },\n name: {\n control: 'text',\n description: 'Nome do dropdown.',\n required: false,\n table: {\n category: 'Properties',\n },\n },\n iconName: {\n control: { type: 'select' },\n options: ['', ...iconNames],\n description: 'Nome do ícone no iconset a ser utilizado.',\n table: {\n category: 'Icons'\n },\n name: 'icon-name'\n },\n required: {\n control: 'boolean',\n description: 'Define se o campo é obrigatório.',\n table: {\n category: 'Properties',\n defaultValue: { summary: false },\n },\n },\n value: {\n control: 'text',\n description: 'Valor atual do campo de busca.',\n table: {\n category: 'Properties',\n },\n },\n placeholder: {\n control: 'text',\n description: 'Texto do placeholder.',\n required: false,\n table: {\n category: 'Properties',\n },\n },\n label: {\n control: 'text',\n description: 'Texto da label do input.',\n required: false,\n table: {\n category: 'Properties',\n },\n },\n dropdownMaxHeight: {\n control: 'text',\n description: 'Altura máxima para o dropdown.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '630px' },\n },\n name: 'dropdown-max-height'\n },\n helperText: {\n control: 'text',\n description: 'Texto de ajuda para o dropdown.',\n table: {\n category: 'Slots',\n },\n },\n oninput: {\n control: 'none',\n description: 'Evento via Listener quando o estado do value do dropdown é alterado',\n table: {\n category: 'Events',\n },\n },\n options: {\n control: { type: 'object' },\n description: 'Um slot name=dropdown-search-option para herdar as opções do dropdown. Pensado para usar o componente `<cura-dropdown-search-option>`',\n table: {\n category: 'Slots',\n defaultValue: { summary: [] },\n },\n },\n },\n};\n\nexport const DropdownSearch = {\n args: {\n status: 'default',\n name: 'cura-dropdown',\n iconName: '',\n required: false,\n value: '',\n placeholder: 'Faça a sua busca',\n label: 'Busca',\n dropdownMaxHeight: '630px',\n helperText: 'Digite o que você deseja buscar.',\n options: [\n {\n value: 'Clinica Médica Geral',\n image: '<cura-icon size=\"24\" name=\"medical\"></cura-icon>',\n content: 'Clinica Médica Geral',\n action: `<cura-button-transparent font-color=\"dark\" color='primary' icon-name='delete' size='small' icon-only={true}></cura-button-transparent>`,\n },\n {\n value: 'Dora Martins de Souza',\n image: '<cura-avatar size=\"32\" imageSrc=\"\"></cura-avatar>',\n content: `Not Selectable Dora Martins de Souza\n <cura-paragraph color=\"neutral-dark\" margin-block=\"0\" size=\"xsmall\">Ortopedista Cirúrgico</cura-paragraph>`,\n action: '',\n selectable: false\n },\n {\n value: 'Copa D’Or - Centro Cardiológico',\n image: `\n <div slot=\"image\">\n <div\n style=\"\n display: flex;\n align-content: center;\n align-items: center;\n justify-content: center;\n text-align: center;\n letter-spacing: 0.72px;\n width: 32px;\n height: 32px;\n border-radius: 4px;\n background-color: #E9E9E9;\n \"\n >\n <cura-label size=\"xsmall\" margin-block=\"0\" lineHeight=\"0\" color=\"neutral-black\" weight=\"bold\">\n 1 <br />\n KM\n </cura-label>\n </div>\n </div>\n `,\n content: `<div style=\"line-height='0';\">\n Copa D’Or - Centro Cardiológico\n <cura-paragraph color=\"neutral-dark\" margin-block=\"0\" size=\"xsmall\">\n Rua Siqueira Campos, 93 Copacabana, Rio de Janeiro\n </cura-paragraph>\n </div>`,\n action: '',\n },\n ],\n },\n};\n"]}
|
|
@@ -46,7 +46,7 @@ export class CuraLabel {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
49
|
-
return (h(Host, { key: '
|
|
49
|
+
return (h(Host, { key: '34d418859c8067e879a089240d36b58f5e91c8fc', style: this.hostCSSProperties() }, h("p", { key: '4a28171e079f80d8e61ebe840b858d65dd6d62c3', style: this.styles, class: this.getClasses() }, h("slot", { key: '0796484498caddf7935ff3458e13cfab47759a4b' }))));
|
|
50
50
|
}
|
|
51
51
|
static get is() { return "cura-label"; }
|
|
52
52
|
static get encapsulation() { return "shadow"; }
|
|
@@ -120,7 +120,7 @@ export class CuraRadio {
|
|
|
120
120
|
return statusColors[this.status][type];
|
|
121
121
|
}
|
|
122
122
|
render() {
|
|
123
|
-
return (h(Host, { key: '
|
|
123
|
+
return (h(Host, { key: 'cd50b6a8c2b43e7ddfc44c2a2d634118e8c8180c' }, h("div", { key: '0ab58b0b1e0561cfbe5801167873d3f1f6b8b48d', class: this.getClasses(), style: this.styles }, h("div", { key: '24399f088f99dd08696b8421140c64765b7ae82f', class: "info" }, h("div", { key: '5fa201595808fd9aede224943fd37cfe8972b51e', class: "label-wrapper" }, h("cura-label", { key: '58f5d8d6f176a1519458c30fbbf0f11bc11b72c1', class: "label", size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && h("cura-paragraph", { key: 'ce96f49de0925ca3739640acadd25bb8d9fbbd26', lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), h("cura-label", { key: 'b2188df747035a27bae0ad5206ac48ef31320268', color: this.assignColor('message'), size: "xsmall", class: "message" }, h("slot", { key: '215226214804fe80e0b049224a590411ddd1f01e' }))), h("input", { key: 'd3fc5b35a27e44f9d8e5f5ab9f9c348ef7bc8bb9', type: "radio", class: `radio ${this.size.toLocaleLowerCase()}`, name: this.name, value: this.value, required: this.required, tabIndex: this.ontabindex, disabled: this.disabled, checked: this.checked, onClick: this.handleClick }))));
|
|
124
124
|
}
|
|
125
125
|
static get is() { return "cura-radio"; }
|
|
126
126
|
static get encapsulation() { return "shadow"; }
|
|
@@ -242,13 +242,13 @@ export class CuraSelect {
|
|
|
242
242
|
return (h("cura-icon", { class: 'feedback-icon', name: icon, iconset: 'default', size: this.size === 'large' ? 20 : 16, color: this.getColor('icon'), style: this.styles }));
|
|
243
243
|
}
|
|
244
244
|
render() {
|
|
245
|
-
return (h(Host, { key: '
|
|
245
|
+
return (h(Host, { key: '35fd5d99705c940578485552a50bcec54efe036e', style: this.styles }, h("div", { key: '1903a7b03e32215678670a2d7d8b49643cc2086b', class: this.getClasses(), tabIndex: 0, ref: (el) => (this.selectRef = el), onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), onKeyDown: this.handleKeyDown, onClick: this.handleClick }, this.label && (h("cura-label", { key: '99aeba22f4b6204d936b6a9dcf6affa29e9411a8', class: 'label', weight: 'bold', size: this.size === 'large' ? 'small' : 'xsmall', color: this.getColor('label') }, this.label, " ", this.required && h("span", { key: '7e335f6fdb0ee6d9e987fba8ec245006f02761b5', class: 'required' }, "* "))), h("div", { key: 'c9ba61c15951f6689724025778fe8a933ab5b9bd', class: {
|
|
246
246
|
'cura-input-field': true,
|
|
247
247
|
'open': this.isOpen
|
|
248
|
-
} }, this.renderIcon(), h("input", { key: '
|
|
248
|
+
} }, this.renderIcon(), h("input", { key: '0c1369e661fc6e34c8bf75f5ef4b977e749dc0b5', tabIndex: 0, type: "text", autocomplete: 'off', onFocus: () => (this.isFocused = true), onBlur: () => (this.isFocused = false), "aria-required": String(this.required), "aria-disabled": String(this.disabled), "aria-invalid": String(this.status === 'error'), onInput: this.handleInputChange, style: this.styles, placeholder: this.placeholder, disabled: this.disabled, required: this.required, value: this.value }), h("cura-icon", { key: '95b5105660bcfc0c1562955449a1fc737048e8c2', name: this.isOpen ? 'up' : 'down', class: "up-down-icon", color: this.disabled ? 'neutral-dark' : 'primary-base', size: 16, iconset: 'default' })), h("cura-label", { key: 'b5565e686989fe0c1e62f6c01fef52b2829bf4f5', class: "helper-text", size: 'xsmall', color: this.getColor('text'), weight: this.mode === 'transparent' ? 'bold' : 'regular' }, h("slot", { key: '4a265609d8742b7e736920d54525cb2405785ea6' })), this.isOpen && (h("div", { key: '8f0609c7c2e709506ea4bdeeebdb1aae8abde1df', class: {
|
|
249
249
|
'menu': true,
|
|
250
250
|
'open': this.isOpen
|
|
251
|
-
} }, h("slot", { key: '
|
|
251
|
+
} }, h("slot", { key: 'b6f84b885909ea1a9213cb3d590a02d736320228', name: 'option' }))))));
|
|
252
252
|
}
|
|
253
253
|
static get is() { return "cura-select"; }
|
|
254
254
|
static get encapsulation() { return "shadow"; }
|
|
@@ -33,7 +33,7 @@ export class CuraSelectOption {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
return (h(Host, { key: '
|
|
36
|
+
return (h(Host, { key: '231c03411af0a5639358ff232e4a81287a8571f0', slot: "option" }, h("div", { key: 'b5baa8f7c4a4e863b96ffda1454a8c339d4b2656', class: this.getClasses(), style: this.styles }, h("cura-label", { key: '36d3381260263303242c443004f7e201c2683d4e', color: `${this.selected ? 'primary-base' : 'neutral-black'}`, size: this.getSize('label'), "margin-block": "0" }, h("slot", { key: 'cc72fed8c51592c8fd076d091272879c7572a181' })), this.selected && h("cura-icon", { key: 'e118108f84d49b3d6574a143f09b2c43d43d11a8', name: 'check', size: this.getSize('icon'), color: "primary-base" }))));
|
|
37
37
|
}
|
|
38
38
|
static get is() { return "cura-select-option"; }
|
|
39
39
|
static get encapsulation() { return "shadow"; }
|
|
@@ -92,7 +92,7 @@ export class CuraSwitch {
|
|
|
92
92
|
return classes;
|
|
93
93
|
}
|
|
94
94
|
render() {
|
|
95
|
-
return (h(Host, { key: '
|
|
95
|
+
return (h(Host, { key: '2ccbfc3c5aae5ec8be3f879541b7cbcf203b62a9' }, h("div", { key: '2acacb0bab31f8736155dc764a6e3d57508f7a48', class: this.getClasses(), style: this.styles }, h("div", { key: '16c7cfedbd029d4e481cb2c3268690d594962ff3', class: "info" }, h("cura-label", { key: '24ed0fd9a9c0ebacc52407319b16a202f2defc96', style: { textAlign: this.position === 'right' ? 'right' : 'left' }, class: "label", weight: "bold", size: this.size === 'large' ? 'medium' : 'xsmall', lineHeight: "125%", color: this.assignColor('neutral-white', 'neutral-black') }, this.label), h("cura-label", { key: '4a84fb18a2fd43c623cb9aa9e9573482a22f6372', style: { textAlign: this.position === 'right' ? 'right' : 'left' }, color: this.assignColor('primary-lighter', 'neutral-dark'), size: "xsmall", class: "message" }, h("slot", { key: '0ec0427dee691d224daa58db943c07d906d08dd0' }))), h("div", { key: '5b4a04200b4880474b693e605ba3e8671a3bd980', onClick: this.toggleSwitch, class: "control" }, h("div", { key: '2e3e764a87d57edc520f9d56b980d80d455d8d74', class: `track ${this.size.toLowerCase()}` }, h("div", { key: '36b9da57ea3b95e419d7bb0b5ad4f24d7acd1b63', class: `thumb ${this.size.toLowerCase()}`, tabIndex: this.ontabindex }))))));
|
|
96
96
|
}
|
|
97
97
|
static get is() { return "cura-switch"; }
|
|
98
98
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
:host .progress-bar {
|
|
5
|
+
position: absolute;
|
|
6
|
+
left: 0;
|
|
7
|
+
bottom: 0;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 4px;
|
|
10
|
+
background-color: var(--neutral-base);
|
|
11
|
+
}
|
|
12
|
+
:host .progress-bar span {
|
|
13
|
+
position: absolute;
|
|
14
|
+
left: 0;
|
|
15
|
+
bottom: 0;
|
|
16
|
+
width: var(--bar-width);
|
|
17
|
+
height: 100%;
|
|
18
|
+
border-radius: 0 2px 2px 0;
|
|
19
|
+
background-color: var(--color-base);
|
|
20
|
+
transition: width 0.2s linear;
|
|
21
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class CuraLoaderBar {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.color = 'primary-base';
|
|
5
|
+
this.progress = 0;
|
|
6
|
+
this.styles = {};
|
|
7
|
+
}
|
|
8
|
+
handleChangeColor() {
|
|
9
|
+
this.setColor();
|
|
10
|
+
}
|
|
11
|
+
handleProgress() {
|
|
12
|
+
this.setProgress();
|
|
13
|
+
}
|
|
14
|
+
connectedCallback() {
|
|
15
|
+
this.setColor();
|
|
16
|
+
this.setProgress();
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return (h(Host, { key: 'fbd3b560f2c5bc00e729300e3f2afa09690cabc8' }, h("div", { key: '0a728618223b33796b63768a543580b5d30e0115', id: "progress-bar", class: "progress-bar", style: this.styles }, h("span", { key: '06230a2ddf4bea3bef96a09814f3e0da9dde31a3', class: "progress-bar-fill" }))));
|
|
20
|
+
}
|
|
21
|
+
setColor() {
|
|
22
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--neutral-base': window.CuraAPI.theme.colors.getColor(`neutral-base`, 0.2), '--color-base': window.CuraAPI.theme.colors.getColor(this.color) });
|
|
23
|
+
}
|
|
24
|
+
setProgress() {
|
|
25
|
+
this.styles = Object.assign(Object.assign({}, this.styles), { '--bar-width': `${this.progress}%` });
|
|
26
|
+
}
|
|
27
|
+
static get is() { return "cura-loader-bar"; }
|
|
28
|
+
static get encapsulation() { return "shadow"; }
|
|
29
|
+
static get originalStyleUrls() {
|
|
30
|
+
return {
|
|
31
|
+
"$": ["cura-loader-bar.scss"]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static get styleUrls() {
|
|
35
|
+
return {
|
|
36
|
+
"$": ["cura-loader-bar.css"]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static get properties() {
|
|
40
|
+
return {
|
|
41
|
+
"color": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"mutable": false,
|
|
44
|
+
"complexType": {
|
|
45
|
+
"original": "string",
|
|
46
|
+
"resolved": "string",
|
|
47
|
+
"references": {}
|
|
48
|
+
},
|
|
49
|
+
"required": false,
|
|
50
|
+
"optional": false,
|
|
51
|
+
"docs": {
|
|
52
|
+
"tags": [],
|
|
53
|
+
"text": ""
|
|
54
|
+
},
|
|
55
|
+
"attribute": "color",
|
|
56
|
+
"reflect": false,
|
|
57
|
+
"defaultValue": "'primary-base'"
|
|
58
|
+
},
|
|
59
|
+
"progress": {
|
|
60
|
+
"type": "number",
|
|
61
|
+
"mutable": false,
|
|
62
|
+
"complexType": {
|
|
63
|
+
"original": "number",
|
|
64
|
+
"resolved": "number",
|
|
65
|
+
"references": {}
|
|
66
|
+
},
|
|
67
|
+
"required": false,
|
|
68
|
+
"optional": false,
|
|
69
|
+
"docs": {
|
|
70
|
+
"tags": [],
|
|
71
|
+
"text": ""
|
|
72
|
+
},
|
|
73
|
+
"attribute": "progress",
|
|
74
|
+
"reflect": false,
|
|
75
|
+
"defaultValue": "0"
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
static get states() {
|
|
80
|
+
return {
|
|
81
|
+
"styles": {}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
static get elementRef() { return "host"; }
|
|
85
|
+
static get watchers() {
|
|
86
|
+
return [{
|
|
87
|
+
"propName": "color",
|
|
88
|
+
"methodName": "handleChangeColor"
|
|
89
|
+
}, {
|
|
90
|
+
"propName": "progress",
|
|
91
|
+
"methodName": "handleProgress"
|
|
92
|
+
}];
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=cura-loader-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cura-loader-bar.js","sourceRoot":"","sources":["../../../../src/components/loaders/cura-loader-bar/cura-loader-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOhF,MAAM,OAAO,aAAa;;qBAGR,cAAc;wBACX,CAAC;sBAEF,EAAE;;IAGpB,iBAAiB;QACf,IAAI,CAAC,QAAQ,EAAE,CAAC;IAClB,CAAC;IAGD,cAAc;QACZ,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,EAAE,EAAC,cAAc,EAAC,KAAK,EAAC,cAAc,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM;gBAC5D,6DAAM,KAAK,EAAC,mBAAmB,GAAQ,CACnC,CACD,CACR,CAAC;IACJ,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,MAAM,mCACN,IAAI,CAAC,MAAM,KACd,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,GAAG,CAAC,EAC3E,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GACjE,CAAA;IACH,CAAC;IAED,WAAW;QACT,IAAI,CAAC,MAAM,mCACN,IAAI,CAAC,MAAM,KACd,aAAa,EAAE,GAAG,IAAI,CAAC,QAAQ,GAAG,GACnC,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-loader-bar',\n styleUrl: 'cura-loader-bar.scss',\n shadow: true,\n})\nexport class CuraLoaderBar {\n @Element() host: HTMLElement;\n\n @Prop() color = 'primary-base';\n @Prop() progress = 0;\n\n @State() styles = {};\n\n @Watch('color')\n handleChangeColor() {\n this.setColor();\n }\n\n @Watch('progress')\n handleProgress() {\n this.setProgress();\n }\n\n connectedCallback() {\n this.setColor();\n this.setProgress();\n }\n \n render() {\n return (\n <Host>\n <div id=\"progress-bar\" class=\"progress-bar\" style={this.styles}>\n <span class=\"progress-bar-fill\"></span>\n </div>\n </Host>\n );\n }\n\n setColor() {\n this.styles = {\n ...this.styles,\n '--neutral-base': window.CuraAPI.theme.colors.getColor(`neutral-base`, 0.2),\n '--color-base': window.CuraAPI.theme.colors.getColor(this.color),\n }\n }\n\n setProgress() {\n this.styles = {\n ...this.styles,\n '--bar-width': `${this.progress}%`,\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s)
|
|
4
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { getColorsWithDepths } from "../../../utils/utils";
|
|
14
|
+
const colors = getColorsWithDepths();
|
|
15
|
+
const renderCuraLoaderBar = (args) => {
|
|
16
|
+
return `<cura-loader-bar
|
|
17
|
+
${args.color ? `color="${args.color}"` : ''}
|
|
18
|
+
${args.progress ? `progress="${args.progress}"` : ''}>
|
|
19
|
+
</cura-loader-bar>`;
|
|
20
|
+
};
|
|
21
|
+
export default {
|
|
22
|
+
title: 'Componentes/Loaders/Loader Bar',
|
|
23
|
+
tags: ['autodocs'],
|
|
24
|
+
render: (_a) => {
|
|
25
|
+
var args = __rest(_a, []);
|
|
26
|
+
return renderCuraLoaderBar(args);
|
|
27
|
+
},
|
|
28
|
+
argTypes: {
|
|
29
|
+
color: {
|
|
30
|
+
control: { type: 'select' },
|
|
31
|
+
options: colors,
|
|
32
|
+
description: 'Cor e profundidade (ex: primary-dark). Se nenhuma profundidade for informada assumirá a base como padrão.',
|
|
33
|
+
table: {
|
|
34
|
+
category: 'Properties',
|
|
35
|
+
defaultValue: { summary: 'primary-base' }
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
progress: {
|
|
39
|
+
control: 'number',
|
|
40
|
+
description: 'Porcentagem do progresso da barra.',
|
|
41
|
+
table: {
|
|
42
|
+
category: 'Properties',
|
|
43
|
+
defaultValue: { summary: 0 },
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
export const LoaderBar = {
|
|
49
|
+
args: {
|
|
50
|
+
color: 'primary-base',
|
|
51
|
+
progress: '50'
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=cura-loader-bar.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cura-loader-bar.stories.js","sourceRoot":"","sources":["../../../../src/components/loaders/cura-loader-bar/cura-loader-bar.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,MAAM,GAAG,mBAAmB,EAAE,CAAC;AAErC,MAAM,mBAAmB,GAAG,CAAC,IAAS,EAAE,EAAE;IACzC,OAAO;IACJ,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE;IACzC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE;qBACjC,CAAC;AACtB,CAAC,CAAA;AAED,eAAe;IACd,KAAK,EAAE,gCAAgC;IACvC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,EAAE,CAAC,EAAW,EAAE,EAAE;YAAV,IAAI,cAAT,EAAW,CAAF;QACf,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,QAAQ,EAAE;QACT,KAAK,EAAE;YACN,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,2GAA2G;YACxH,KAAK,EAAE;gBACN,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,cAAc,EAAC;aACxC;SACD;QACD,QAAQ,EAAE;YACN,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,oCAAoC;YACjD,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;aAC7B;SACF;KACH;CACD,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE;QACJ,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE,IAAI;KACf;CACF,CAAC","sourcesContent":["import { getColorsWithDepths } from \"../../../utils/utils\";\n\nconst colors = getColorsWithDepths();\n\nconst renderCuraLoaderBar = (args: any) => {\n\treturn `<cura-loader-bar\n\t\t${args.color ? `color=\"${args.color}\"` : ''}\n\t\t${args.progress ? `progress=\"${args.progress}\"` : ''}>\n\t\t</cura-loader-bar>`;\n}\n\nexport default {\n\ttitle: 'Componentes/Loaders/Loader Bar',\n\ttags: ['autodocs'],\n\trender: ({ ...args }) => {\n return renderCuraLoaderBar(args);\n\t},\n\targTypes: {\n\t\tcolor: {\n\t\t\tcontrol: { type: 'select' },\n\t\t\toptions: colors,\n\t\t\tdescription: 'Cor e profundidade (ex: primary-dark). Se nenhuma profundidade for informada assumirá a base como padrão.',\n\t\t\ttable: {\n\t\t\t\tcategory: 'Properties',\n\t\t\t\tdefaultValue: { summary: 'primary-base'}\n\t\t\t}\n\t\t},\n\t\tprogress: {\n control: 'number',\n description: 'Porcentagem do progresso da barra.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 0 },\n },\n }\n\t},\n};\n\nexport const LoaderBar = {\n args: {\n color: 'primary-base',\n progress: '50'\n },\n};\n"]}
|
|
@@ -19,7 +19,7 @@ export class CuraLoaderCircle {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: 'dd0c9e5b82f8f3b41511d31333af00e46435e9db', style: this.getStyles() }, h("svg", { key: '2a6a1edab6501c7788bebed93bbc87143d10fbaf', viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { key: '8dd113e23ffc4f5df091738a878eee76e030c904' }, h("circle", { key: 'a6e06aad2260ffb8cec65aed59ef8f09459765a1', cx: "8", cy: "8", r: "7", stroke: "url(#paint0_linear_13485_11488)", "stroke-width": "2" }), h("path", { key: '88ac6f03cac1030593e06e6062d8d9947474aa62', d: "M1 8C1 4.13401 4.11877 1 7.96596 1C9.53445 1 10.9819 1.52093 12.1462 2.4C12.8959 2.96601 13.5282 3.68049 14 4.5", "stroke-width": "2" })), h("defs", { key: '6bae1e73907f3f8a17560ef055290c4ac41959e7' }, h("linearGradient", { key: 'c2510effd844984927f4b32fbb7f770ebcb09a3c', id: "paint0_linear_13485_11488", x1: "15.7", y1: "4.5", x2: "4.15", y2: "11.5", gradientUnits: "userSpaceOnUse" }, h("stop", { key: '477e90e9eadf1385a8b897917886e1fe352c41d0' }), h("stop", { key: '135e22c3a11916fa1ce4bc5870774ecf37512e6f', offset: "1" }))))));
|
|
23
23
|
}
|
|
24
24
|
static get is() { return "cura-loader-circle"; }
|
|
25
25
|
static get encapsulation() { return "shadow"; }
|
|
@@ -51,7 +51,7 @@ export class CuraDisplay {
|
|
|
51
51
|
return tags[`${this.level}`] || tags['default'];
|
|
52
52
|
}
|
|
53
53
|
render() {
|
|
54
|
-
return (h(Host, { key: '
|
|
54
|
+
return (h(Host, { key: '89df8c001192a7526e6976d9b43099562d65809d', style: this.hostCSSProperties() }, this.getHeadingTag()));
|
|
55
55
|
}
|
|
56
56
|
static get is() { return "cura-display"; }
|
|
57
57
|
static get encapsulation() { return "shadow"; }
|
|
@@ -61,7 +61,7 @@ export class CuraHeading {
|
|
|
61
61
|
return tags[`${this.level}`] || tags['default'];
|
|
62
62
|
}
|
|
63
63
|
render() {
|
|
64
|
-
return (h(Host, { key: '
|
|
64
|
+
return (h(Host, { key: '55016d81f72ce0b506a7e2f2fbca3aa92448d581', style: this.hostCSSProperties() }, this.getHeadingTag()));
|
|
65
65
|
}
|
|
66
66
|
static get is() { return "cura-heading"; }
|
|
67
67
|
static get encapsulation() { return "shadow"; }
|
|
@@ -45,7 +45,7 @@ export class CuraParagraph {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return (h(Host, { key: '
|
|
48
|
+
return (h(Host, { key: '2c9903f885ae8346efdbb1569264fc078aee9224', style: this.hostCSSProperties() }, h("p", { key: '287c656408d2e9876497f70784ae7ce166417272', style: this.styles, class: this.setsizeClass() }, h("slot", { key: 'dde5f8d46c384a76605c1ef33b73c8f442c7a48b' }))));
|
|
49
49
|
}
|
|
50
50
|
static get is() { return "cura-paragraph"; }
|
|
51
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -159,7 +159,7 @@ const CuraCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class CuraCheckbox exten
|
|
|
159
159
|
return h("cura-icon", { class: "icon", name: iconName, size: iconSize, color: iconColor });
|
|
160
160
|
}
|
|
161
161
|
render() {
|
|
162
|
-
return (h(Host, { key: '
|
|
162
|
+
return (h(Host, { key: 'b74eebdbcaed952fa2157c3cbb3a84ce92bb9e6c' }, h("div", { key: 'e18e4e5aa12a3e298db65399ebf002aa991100f2', class: this.getClasses(), style: this.styles, onClick: this.handleClick }, h("div", { key: 'fdbcf3ec4b12bf9c6d80cded5ce9d17c4f5e2a39', class: "info" }, h("div", { key: 'cbe76b43956bed00ab638b953a44d941ffb748d5', class: "label-wrapper" }, h("cura-label", { key: '259c5e5e63a6d36ed15845899eaf8c76b2b50273', class: "label", weight: 'bold', size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && h("cura-paragraph", { key: '42d8b2777d4790bd8f83a7ddc939c6ab584b5cf0', lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), h("cura-label", { key: 'bcafaacf64c8967f78a3e9b7ecfe6d1412517ea3', color: this.assignColor('message'), size: "xsmall", class: "message" }, h("slot", { key: 'c9cc9e74cc9048ead8375a158253491e1aae4dfe' }))), h("div", { key: 'e63ba7ef796c9d46cf4729facf1be985b8174028', class: 'checkbox', tabIndex: this.ontabindex }, h("input", { key: '2e7e2e302e577f26d8022fe4a0108f0e6727450f', type: "checkbox", name: this.name, value: this.value, disabled: this.disabled, required: this.required, checked: this.checked, indeterminate: this.indeterminate }), this.getIcon()))));
|
|
163
163
|
}
|
|
164
164
|
static get formAssociated() { return true; }
|
|
165
165
|
get host() { return this; }
|
|
@@ -58,7 +58,7 @@ const CuraDisplay$1 = /*@__PURE__*/ proxyCustomElement(class CuraDisplay extends
|
|
|
58
58
|
return tags[`${this.level}`] || tags['default'];
|
|
59
59
|
}
|
|
60
60
|
render() {
|
|
61
|
-
return (h(Host, { key: '
|
|
61
|
+
return (h(Host, { key: '89df8c001192a7526e6976d9b43099562d65809d', style: this.hostCSSProperties() }, this.getHeadingTag()));
|
|
62
62
|
}
|
|
63
63
|
get host() { return this; }
|
|
64
64
|
static get watchers() { return {
|
|
@@ -11,7 +11,7 @@ const CuraDropdownSearchOptionTitle$1 = /*@__PURE__*/ proxyCustomElement(class C
|
|
|
11
11
|
this.__attachShadow();
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: 'd27a47a6d61497f488c449188b2c6036529350cc', slot: "dropdown-search-option" }, h("cura-label", { key: 'ba63e9fce7392087551ccc7fb46a83cffa6785c9', color: "neutral-dark", size: "xsmall", lineHeight: "16px", marginBlock: "0" }, h("slot", { key: 'f14d41a3ed995f6f9a946e7d96e5c0b0208310ad' }))));
|
|
15
15
|
}
|
|
16
16
|
static get style() { return CuraDropdownSearchOptionTitleStyle0; }
|
|
17
17
|
}, [1, "cura-dropdown-search-option-title"]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$2 } from './cura-heading2.js';
|
|
3
3
|
|
|
4
|
-
const curaDropdownSearchOptionCss = ":host{display:block;box-sizing:border-box;width:100%}ul{list-style:none;width:100%;margin:0;padding:0}li{width:100%;display:flex;align-items:center;align-content:center;justify-content:center;gap:8px;padding:8px 4px;flex-direction:row;background-color:var(--neutral-purewhite);border-bottom:1px solid var(--neutral-light);box-sizing:border-box;cursor:pointer}li.hovered{background-color:var(--neutral-white)}li cura-heading{width:100%;margin-block:0px}li ::slotted(div[slot=image]){min-width:32px;display:flex;justify-content:center;align-items:center}li ::slotted(div[slot=action]){display:flex;justify-content:end}li.selected{background-color:var(--primary-lighter)}li:hover{background-color:var(--neutral-white)}";
|
|
4
|
+
const curaDropdownSearchOptionCss = ":host{display:block;box-sizing:border-box;width:100%}ul{list-style:none;width:100%;margin:0;padding:0}li{width:100%;display:flex;align-items:center;align-content:center;justify-content:center;gap:8px;padding:8px 4px;flex-direction:row;background-color:var(--neutral-purewhite);border-bottom:1px solid var(--neutral-light);box-sizing:border-box;cursor:pointer}li.disabled{cursor:default}li.hovered{background-color:var(--neutral-white)}li cura-heading{width:100%;margin-block:0px}li ::slotted(div[slot=image]){min-width:32px;display:flex;justify-content:center;align-items:center}li ::slotted(div[slot=action]){display:flex;justify-content:end}li.selected{background-color:var(--primary-lighter)}li:hover:not(.disabled){background-color:var(--neutral-white)}";
|
|
5
5
|
const CuraDropdownSearchOptionStyle0 = curaDropdownSearchOptionCss;
|
|
6
6
|
|
|
7
7
|
const CuraDropdownSearchOption$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdownSearchOption extends HTMLElement {
|
|
@@ -10,13 +10,20 @@ const CuraDropdownSearchOption$1 = /*@__PURE__*/ proxyCustomElement(class CuraDr
|
|
|
10
10
|
this.__registerHost();
|
|
11
11
|
this.__attachShadow();
|
|
12
12
|
this.optionSelected = createEvent(this, "optionSelected", 7);
|
|
13
|
-
this.handleOptionClick = () => {
|
|
14
|
-
this.
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
this.handleOptionClick = (e) => {
|
|
14
|
+
if (this.selectable) {
|
|
15
|
+
this.selected = !this.selected;
|
|
16
|
+
this.optionSelected.emit(this.value);
|
|
17
|
+
this.updateIconColor();
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
e.stopImmediatePropagation();
|
|
22
|
+
}
|
|
17
23
|
};
|
|
18
24
|
this.value = undefined;
|
|
19
25
|
this.selected = false;
|
|
26
|
+
this.selectable = true;
|
|
20
27
|
this.hovered = false;
|
|
21
28
|
this.styles = {};
|
|
22
29
|
}
|
|
@@ -37,10 +44,11 @@ const CuraDropdownSearchOption$1 = /*@__PURE__*/ proxyCustomElement(class CuraDr
|
|
|
37
44
|
}
|
|
38
45
|
}
|
|
39
46
|
render() {
|
|
40
|
-
return (h(Host, { key: '
|
|
41
|
-
hovered: this.hovered,
|
|
47
|
+
return (h(Host, { key: 'aa4b585c3f67a74d1371430200ad309f74015af6', style: this.styles, slot: "dropdown-search-option" }, h("ul", { key: '5413964e5e10e68e4ff2ac30f68f6e22cff6dcc1' }, h("li", { key: '3aab9b7d5e3904e57a7310addc4b15a51453d31d', onClick: (e) => this.handleOptionClick(e), value: this.value, class: {
|
|
48
|
+
hovered: this.selectable ? this.hovered : false,
|
|
42
49
|
selected: this.selected,
|
|
43
|
-
|
|
50
|
+
disabled: !this.selectable
|
|
51
|
+
} }, h("slot", { key: '030c06f2e9bcfd0169b8d94c8976cd4b1e25b834', name: "image" }), h("cura-heading", { key: 'f5bd16d815a853a41d98aac09517359a5e1b432d', size: "xsmall", lineHeight: "16px", marginBlock: "0px", weight: "bold", color: "neutral-black" }, h("slot", { key: '878d1db64dc98c57530adf947cbc216ac1ce1be0' })), h("slot", { key: '81c92fcb864bc8f2324cc353574123705fc386a8', name: "action" })))));
|
|
44
52
|
}
|
|
45
53
|
get hostElement() { return this; }
|
|
46
54
|
static get watchers() { return {
|
|
@@ -50,6 +58,7 @@ const CuraDropdownSearchOption$1 = /*@__PURE__*/ proxyCustomElement(class CuraDr
|
|
|
50
58
|
}, [1, "cura-dropdown-search-option", {
|
|
51
59
|
"value": [513],
|
|
52
60
|
"selected": [1540],
|
|
61
|
+
"selectable": [516],
|
|
53
62
|
"hovered": [1540],
|
|
54
63
|
"styles": [32]
|
|
55
64
|
}, undefined, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file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AAE,EAAE,CAAC,CAAC;KAChG;IAaD,gBAAgB;QACd,IAAI,CAAC,eAAe,EAAE,CAAC;KACxB;IAGO,eAAe;QACrB,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;QAC/E,IAAI,WAAW,EAAE;YACf,WAAW,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,GAAG,SAAS,GAAG,cAAc,CAAC,CAAC;SAC/E;KACF;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAC,wBAAwB,IACrD,6DACE,2DACE,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EACzC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE;gBACL,OAAO,EAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,GAAG,KAAK;gBAC/C,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,QAAQ,EAAE,CAAC,IAAI,CAAC,UAAU;aAC3B,IAED,6DAAM,IAAI,EAAC,OAAO,GAAQ,EAC1B,qEAAc,IAAI,EAAC,QAAQ,EAAC,UAAU,EAAC,MAAM,EAAC,WAAW,EAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,KAAK,EAAC,eAAe,IACjG,8DAAa,CACA,EACf,6DAAM,IAAI,EAAC,QAAQ,GAAQ,CACxB,CACF,CACA,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CuraDropdownSearchOption"],"sources":["src/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.scss?tag=cura-dropdown-search-option&encapsulation=shadow","src/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.tsx"],"sourcesContent":[":host {\n display: block;\n box-sizing: border-box;\n width: 100%;\n}\n\nul {\n list-style: none;\n width: 100%;\n margin: 0;\n padding: 0;\n}\nli {\n width: 100%;\n display: flex;\n align-items: center;\n align-content: center;\n justify-content: center;\n gap: 8px;\n padding: 8px 4px;\n flex-direction: row;\n background-color: var(--neutral-purewhite);\n border-bottom: 1px solid var(--neutral-light);\n box-sizing: border-box;\n cursor: pointer;\n\n &.disabled {\n cursor: default;\n }\n\n &.hovered {\n background-color: var(--neutral-white);\n }\n\n cura-heading {\n width: 100%;\n margin-block: 0px;\n }\n\n ::slotted(div[slot='image']) {\n min-width: 32px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n ::slotted(div[slot='action']) {\n display: flex;\n justify-content: end;\n }\n\n &.selected {\n background-color: var(--primary-lighter);\n }\n\n &:hover:not(.disabled) {\n background-color: var(--neutral-white);\n }\n}\n","import { Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-dropdown-search-option',\n styleUrl: 'cura-dropdown-search-option.scss',\n shadow: true,\n})\nexport class CuraDropdownSearchOption {\n /**\n * The value of the dropdown search option.\n */\n @Prop({ reflect: true }) value: string;\n\n /**\n * Indicates if the dropdown search option is selected.\n */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n\n /**\n * Indicates if the dropdown search is selectable.\n */\n @Prop({ reflect: true }) selectable: boolean = true;\n\n /**\n * Indicates if the dropdown search option is hovered.\n */\n @Prop({ reflect: true, mutable: true }) hovered: boolean = false;\n\n @State() styles = {};\n\n /**\n * Event emitted when the option is selected.\n */\n @Event() optionSelected: EventEmitter<string>;\n\n @Element() hostElement: HTMLElement;\n\n weights;\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor(`neutral-purewhite`);\n this.styles['--neutral-light'] = window.CuraAPI.theme.colors.getColor(`neutral-light`);\n this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);\n this.styles['--primary-lighter'] = window.CuraAPI.theme.colors.getColor(`primary-lighter`, 50);\n }\n\n private handleOptionClick = (e: Event) => {\n if (this.selectable) {\n this.selected = !this.selected;\n this.optionSelected.emit(this.value);\n this.updateIconColor();\n } else {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n };\n\n componentDidLoad() {\n this.updateIconColor();\n }\n\n @Watch('selected')\n private updateIconColor() {\n const iconElement = this.hostElement.querySelector('[slot=\"image\"] cura-icon');\n if (iconElement) {\n iconElement.setAttribute('color', this.selected ? 'primary' : 'neutral-dark');\n }\n }\n\n render() {\n return (\n <Host style={this.styles} slot=\"dropdown-search-option\">\n <ul>\n <li\n onClick={(e) => this.handleOptionClick(e)}\n value={this.value}\n class={{\n hovered: this.selectable ? this.hovered : false,\n selected: this.selected,\n disabled: !this.selectable\n }}\n >\n <slot name=\"image\"></slot>\n <cura-heading size=\"xsmall\" lineHeight=\"16px\" marginBlock=\"0px\" weight=\"bold\" color=\"neutral-black\">\n <slot></slot>\n </cura-heading>\n <slot name=\"action\"></slot>\n </li>\n </ul>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -5,7 +5,7 @@ import { d as defineCustomElement$4 } from './cura-input-text2.js';
|
|
|
5
5
|
import { d as defineCustomElement$3 } from './cura-label2.js';
|
|
6
6
|
import { d as defineCustomElement$2 } from './cura-loader-circle2.js';
|
|
7
7
|
|
|
8
|
-
const curaDropdownSearchCss = ":host{display:block;width:100%;box-sizing:border-box}.dropdown{display:flex;position:relative;flex-direction:column;width:inherit}.dropdown-input-search{width:100%;display:flex;justify-content:center;align-items:center;background:transparent}.dropdown-input-search.dropdown-open ::part(cura-input-field){border-radius:4px 4px 0px 0px}.dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:none}.dropdown-input-search.dropdown-open cura-input-text ::slotted([slot=helperText]){display:none}.dropdown-search-list{position:absolute;top:calc(100% - 8px);width:100%;max-height:
|
|
8
|
+
const curaDropdownSearchCss = ":host{display:block;width:100%;box-sizing:border-box}.dropdown{display:flex;position:relative;flex-direction:column;width:inherit}.dropdown-input-search{width:100%;display:flex;justify-content:center;align-items:center;background:transparent}.dropdown-input-search.dropdown-open ::part(cura-input-field){border-radius:4px 4px 0px 0px}.dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:none}.dropdown-input-search.dropdown-open cura-input-text ::slotted([slot=helperText]){display:none}.dropdown-search-list{position:absolute;top:calc(100% - 8px);width:100%;max-height:var(--dropdown-max-height);padding:12px 12px;margin:0;box-sizing:border-box;box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));border-radius:0px 0px 4px 4px;border-top:0 var(--neutral-light);border-right:2px solid var(--neutral-light);border-bottom:2px solid var(--neutral-light);border-left:2px solid var(--neutral-light);background-color:var(--neutral-purewhite);list-style:none;overflow-y:auto;display:none}.dropdown-search-list.visible{display:block}.dropdown-search-list-input-search{width:inherit;display:flex;justify-content:center;align-items:center;padding:16px 8px;border-bottom:2px solid var(--info-base);background-color:var(--neutral-purewhite)}.dropdown-search-list-input-search cura-input-text{width:inherit}.dropdown-search-list-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile{position:fixed;top:0;left:0;right:0;width:100%;z-index:10000}.dropdown-mobile .dropdown-input-search{display:flex;gap:4px;padding:12px 8px;background-color:var(--neutral-purewhite);border-bottom:2px solid var(--info-base);z-index:10000}.dropdown-mobile .dropdown-input-search cura-button-transparent{display:flex}.dropdown-mobile .dropdown-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile .dropdown-input-search.dropdown-open{display:flex}.dropdown-mobile .dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:block}.dropdown-mobile .dropdown-search-list{position:static;width:100%;height:100%;max-height:none;padding:12px 12px;margin:0;box-sizing:border-box;box-shadow:none;border:none;background-color:var(--neutral-purewhite);list-style:none;overflow-y:auto;z-index:10000}";
|
|
9
9
|
const CuraDropdownSearchStyle0 = curaDropdownSearchCss;
|
|
10
10
|
|
|
11
11
|
const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdownSearch extends HTMLElement {
|
|
@@ -25,7 +25,7 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
25
25
|
const input = event.target;
|
|
26
26
|
this.value = input.value;
|
|
27
27
|
this.onValueChange(this.value);
|
|
28
|
-
this.valueChanged.emit(this.value);
|
|
28
|
+
// this.valueChanged.emit(this.value);
|
|
29
29
|
};
|
|
30
30
|
this.handleKeyDown = (event) => {
|
|
31
31
|
if (event.key === 'ArrowDown') {
|
|
@@ -63,6 +63,7 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
63
63
|
this.placeholder = '';
|
|
64
64
|
this.label = '';
|
|
65
65
|
this.iconName = 'search';
|
|
66
|
+
this.dropdownMaxHeight = '630px';
|
|
66
67
|
this.overlayVisible = false;
|
|
67
68
|
this.isDropdownOpen = false;
|
|
68
69
|
this.styles = {};
|
|
@@ -89,12 +90,12 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
89
90
|
}
|
|
90
91
|
onValueChange(newValue) {
|
|
91
92
|
this.updateSelectedOption(newValue);
|
|
93
|
+
this.valueChanged.emit(this.value);
|
|
92
94
|
}
|
|
93
95
|
componentWillLoad() {
|
|
94
96
|
this.updateSelectedOption(this.value);
|
|
95
97
|
}
|
|
96
98
|
componentDidRender() {
|
|
97
|
-
console.log(this.options);
|
|
98
99
|
if (this.isDropdownOpen && this.isMobile) {
|
|
99
100
|
this.showOverlay();
|
|
100
101
|
}
|
|
@@ -142,12 +143,14 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
142
143
|
}
|
|
143
144
|
onSelectedOption(index) {
|
|
144
145
|
const selectedOption = this.options[index];
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
if (selectedOption.selectable) {
|
|
147
|
+
const selectedValue = selectedOption.getAttribute('value') || selectedOption.textContent;
|
|
148
|
+
this.value = selectedValue || '';
|
|
149
|
+
this.updateSelectedOption(this.value);
|
|
150
|
+
this.isDropdownOpen = false;
|
|
151
|
+
this.isOnBlurInput = true;
|
|
152
|
+
this.removeOverlay();
|
|
153
|
+
}
|
|
151
154
|
}
|
|
152
155
|
moveHighlight(direction) {
|
|
153
156
|
const visibleOptions = this.options;
|
|
@@ -202,11 +205,16 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
202
205
|
'visible': this.options.length && this.isDropdownOpen ? true : false
|
|
203
206
|
};
|
|
204
207
|
}
|
|
208
|
+
hostCSSProperties() {
|
|
209
|
+
return {
|
|
210
|
+
'--dropdown-max-height': this.dropdownMaxHeight,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
205
213
|
render() {
|
|
206
214
|
const isMobileDropdown = this.isMobile && this.isDropdownOpen;
|
|
207
|
-
return (h(Host, { key: '
|
|
215
|
+
return (h(Host, { key: '993da099b8256bfb9ee7b3ebabd4860e9019d097', style: this.hostCSSProperties(), class: "dropdown-overlay" }, h("div", { key: '883246cc7a1020ba83a4eda4fb1f6483519314cf', class: `dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`, style: this.styles }, h("div", { key: '5189508f35c5fc62883820a8c378bce8a3e67b7d', class: this.getClasses() }, this.isMobile && this.isDropdownOpen && (h("cura-button-transparent", { key: 'cbedd224556935a715380168c1be22d3127e920c', fontColor: "dark", onClick: () => (this.isMobile = false), iconName: "arrowLeft", size: "medium", iconOnly: true, color: "primary" })), h("cura-input-text", { key: 'a8dd2fe42d5bc64683ba56e7bad6b6d08ce92fca', label: this.label, part: "cura-input-field", mode: isMobileDropdown ? 'transparent' : 'default', required: this.required, hideErrorIcon: this.status === 'error', iconName: this.iconName || 'search', value: this.value, status: this.status, onValueChange: e => this.onValueChange(e.target.value), onInput: e => this.handleInputChange(e), onFocus: () => (this.isDropdownOpen = true), onClick: () => (window.innerWidth < 768 ? (this.isMobile = true) : null), onBlur: () => {
|
|
208
216
|
this.handleOnBlur();
|
|
209
|
-
}, placeholder: this.placeholder, size: "large", onKeyDown: this.handleKeyDown }, h("slot", { key: '
|
|
217
|
+
}, placeholder: this.placeholder, size: "large", onKeyDown: this.handleKeyDown }, h("slot", { key: '9991e5cfd78b73b9b2da92ae217fad3ae109a2c9', name: "helperText" }))), h("div", { key: '664abccc90e95b83aa3192282453d199ae2a0c5f', id: "dropdown-search-list", class: this.getDropdownClasses() }, h("slot", { key: '2eca99c0ec684020000edc46ebbc5f8097e78200', name: "dropdown-search-option", onSlotchange: this.handleSlotChange })))));
|
|
210
218
|
}
|
|
211
219
|
get host() { return this; }
|
|
212
220
|
static get watchers() { return {
|
|
@@ -222,6 +230,7 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
222
230
|
"placeholder": [1537],
|
|
223
231
|
"label": [1537],
|
|
224
232
|
"iconName": [513, "icon-name"],
|
|
233
|
+
"dropdownMaxHeight": [513, "dropdown-max-height"],
|
|
225
234
|
"overlayVisible": [32],
|
|
226
235
|
"isDropdownOpen": [32],
|
|
227
236
|
"styles": [32],
|