@rededor/cura 1.6.0 → 1.6.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cura-accordion_18.cjs.entry.js +23 -4
- package/dist/cjs/cura-accordion_18.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-calendar.cjs.entry.js +2997 -198
- package/dist/cjs/cura-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/cura.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.css +6 -2
- package/dist/collection/components/cura-calendar/cura-calendar.css +35 -4
- package/dist/collection/components/cura-calendar/cura-calendar.js +17 -9
- package/dist/collection/components/cura-calendar/cura-calendar.js.map +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js +0 -1
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js.map +1 -1
- package/dist/collection/components/cura-card/cura-card.stories.js +56 -25
- package/dist/collection/components/cura-card/cura-card.stories.js.map +1 -1
- package/dist/collection/components/cura-dropdown-search/cura-dropdown-search.js +6 -1
- package/dist/collection/components/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
- package/dist/collection/components/cura-modal/cura-modal.css +6 -2
- package/dist/collection/components/cura-page-template/cura-page-template.css +6 -2
- package/dist/collection/components/cura-toast/cura-toast.css +6 -2
- package/dist/collection/components/cura-tooltip/cura-tooltip.css +6 -2
- package/dist/collection/components/forms/cura-label/cura-label.css +6 -2
- package/dist/collection/components/forms/cura-select/cura-select.js +17 -3
- package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -1
- package/dist/collection/components/text/cura-display/cura-display.css +6 -2
- package/dist/collection/components/text/cura-heading/cura-heading.css +6 -2
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.css +6 -2
- package/dist/collection/stories/blocks/index.js +9 -0
- package/dist/components/cura-calendar2.js +2999 -200
- package/dist/components/cura-calendar2.js.map +1 -1
- package/dist/components/cura-dropdown-search.js +6 -1
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/cura-select2.js +17 -3
- package/dist/components/cura-select2.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-2090e71a.entry.js +2 -0
- package/dist/cura/p-2090e71a.entry.js.map +1 -0
- package/dist/cura/p-e5abb2a4.entry.js +2 -0
- package/dist/cura/p-e5abb2a4.entry.js.map +1 -0
- package/dist/esm/cura-accordion_18.entry.js +23 -4
- package/dist/esm/cura-accordion_18.entry.js.map +1 -1
- package/dist/esm/cura-calendar.entry.js +2997 -198
- package/dist/esm/cura-calendar.entry.js.map +1 -1
- package/dist/esm/cura.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cura-calendar/cura-calendar.stories.d.ts +0 -1
- package/dist/types/components/cura-card/cura-card.stories.d.ts +7 -98
- package/dist/types/components/cura-dropdown-search/cura-dropdown-search.d.ts +1 -0
- package/dist/types/components/forms/cura-select/cura-select.d.ts +3 -0
- package/package.json +15 -11
- package/dist/cura/p-5b928e46.entry.js +0 -2
- package/dist/cura/p-5b928e46.entry.js.map +0 -1
- package/dist/cura/p-62c1b0f4.entry.js +0 -2
- package/dist/cura/p-62c1b0f4.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-calendar.stories.js","sourceRoot":"","sources":["../../../src/components/cura-calendar/cura-calendar.stories.tsx"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,IAAI,CAAC,EAAE,CAAC;;QAE3B,IAAI,CAAC,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,GAAG;QACxC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,CAAC,KAAK,GAAG;QACrC,IAAI,CAAC,QAAQ,IAAI,cAAc,IAAI,CAAC,QAAQ,GAAG;QAC/C,IAAI,CAAC,QAAQ,IAAI,cAAc,IAAI,CAAC,QAAQ,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YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;SACb;QACD,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,OAAO;QACjB,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,YAAY;QACxB,WAAW,EAAE,CAAC,YAAY,CAAC;QAC3B,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,IAAI;QAChB,gBAAgB,EAAE,KAAK;QACvB,kBAAkB,EAAE,KAAK;QACzB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;QACd,oBAAoB,EAAE,OAAO;KAC9B;CACF,CAAC","sourcesContent":["const renderCuraCalendar = args => `\n <cura-calendar\n ${args.period && `period=\"${args.period}\"`}\n ${args.width && `width=\"${args.width}\"`}\n ${args.maxWidth && `max-width=\"${args.maxWidth}\"`}\n ${args.minWidth && `min-width=\"${args.minWidth}\"`}\n ${args.mode && `mode=\"${args.mode}\"`}\n ${args.type && `type=\"${args.type}\"`}\n ${args.dateFormat && `date-format=\"${args.dateFormat}\"`}\n ${args.locale && `locale=\"${args.locale}\"`}\n ${`enable=\"${args.enable.length > 0 ? args.enable : '[]'}\"`}\n ${`disable=\"${args.disable.length > 0 ? args.disable : '[]'}\"`}\n ${`default-date='${args.defaultDate.length > 0 ? JSON.stringify(args.defaultDate) : '[]'}'`}\n\n ${args.disablePassDates && `disable-pass-dates=\"${args.disablePassDates}\"`}\n ${args.disableFutureDates && `disable-future-dates=\"${args.disableFutureDates}\"`}\n ${args.collapsed && `collapsed=\"${args.collapsed}\"`}\n ${args.floating && `floating=\"${args.floating}\"`}\n ${args.embedded && `embedded=\"${args.embedded}\"`}\n ${args.limitRange !== null ? `limit-range=\"${args.limitRange}\"` : ''}\n ${args.selectLabelColorMode && `select-label-color-mode=\"${args.selectLabelColorMode}\"`}\n ></cura-calendar>\n`;\n\nexport default {\n title: 'Componentes/Calendar/Calendar',\n tags: ['autodocs'],\n parameters: {\n layout: 'centered',\n },\n render: args => renderCuraCalendar(args),\n argTypes: {\n period: {\n control: 'array',\n description: 'Define os períodos disponíveis para o calendário. Quando não informado, considera todas as datas como habilitadas',\n table: {\n category: 'Properties',\n defaultValue: { summary: null },\n },\n },\n width: {\n control: 'text',\n description: 'Define a largura do calendário. <b>Largura minima \"268px\"</b>.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '268px' },\n },\n },\n maxWidth: {\n control: 'text',\n description: 'Define a largura máxima do calendário. <b>Largura máxima \"400px\"</b>.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '400px' },\n },\n },\n minWidth: {\n control: 'text',\n description: 'Define a largura mínima do calendário. <b>Largura mínima \"268px\"</b>.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '268px' },\n },\n },\n mode: {\n control: 'inline-radio',\n options: ['single', 'multiple', 'range'],\n description: 'Define o modo de seleção de datas.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'single' },\n },\n },\n type: {\n control: 'inline-radio',\n options: ['static', 'dropdown'],\n description: 'Define o tipo de visualização (mês/ano) do calendário.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'static' },\n },\n },\n dateFormat: {\n control: 'text',\n description: 'Define o formato das datas exibidas.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'yyyy-MM-dd' },\n },\n },\n locale: {\n control: 'inline-radio',\n options: ['pt-BR', 'en-US'],\n description: 'Define o idioma/localização do calendário.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'pt-BR' },\n },\n },\n defaultDate: {\n control: 'array',\n description: 'Define as datas que serão pré-selecionadas no calendário.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '[]' },\n },\n },\n enable: {\n control: 'array',\n description: 'Define as datas que são habilitadas para seleção.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '[]' },\n },\n },\n disable: {\n control: 'array',\n description: 'Define as datas que são desabilitadas para seleção.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '[]' },\n },\n },\n limitRange: {\n control: 'number',\n description: 'Define o limite de datas selecionáveis no modo de seleção range.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'null' },\n },\n },\n disablePassDates: {\n control: 'boolean',\n description: 'Define se as datas anteriores a data atual serão consideras como desabilitadas',\n table: {\n category: 'Properties',\n defaultValue: { summary: false },\n },\n },\n disableFutureDates: {\n control: 'boolean',\n description: 'Define se as datas futuras a data atual serão consideras como desabilitadas',\n table: {\n category: 'Properties',\n defaultValue: { summary: false },\n },\n },\n collapsed: {\n control: 'boolean',\n description: 'Define se a exibição do calendário será com recolhida ou expandida ',\n table: {\n category: 'Properties',\n defaultValue: { summary: null },\n },\n },\n floating: {\n control: 'boolean',\n description: 'Define se o componente é flutuante e aplica o sombreamento.',\n table: {\n category: 'Properties',\n defaultValue: { summary: true },\n },\n },\n embedded: {\n control: 'boolean',\n description: 'Define se o componente tenha borda, padding e sombra (box) ou não.',\n table: {\n category: 'Properties',\n defaultValue: { summary: true },\n },\n },\n selectLabelColorMode: {\n control: { type: 'inline-radio' },\n options: ['light', 'dark'],\n description: 'Define a cor do label do dia selecionado (light ou dark).',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'light' },\n },\n name: 'select-label-color-mode',\n },\n },\n};\n\nexport const Calendar = {\n args: {\n period: [\n '2024-08-01',\n '2024-08-30',\n '2024-08-02',\n '2024-08-03',\n '2024-08-04',\n '2024-08-29',\n '2024-08-15',\n '2024-08-02',\n '2024-08-30',\n '2024-09-01',\n '2024-09-29',\n '2024-10-15',\n '2024-09-02',\n '2024-09-30',\n '2024-10-01',\n ],\n width: '280px',\n maxWidth: '400px',\n minWidth: '268px',\n mode: 'single',\n type: 'static',\n locale: 'pt-BR',\n dateFormat: 'yyyy-MM-dd',\n defaultDate: ['2024-08-15'],\n enable: [],\n disable: [],\n limitRange: null,\n disablePassDates: false,\n disableFutureDates: false,\n collapsed: null,\n floating: true,\n embedded: true,\n selectLabelColorMode: 'light',\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"cura-calendar.stories.js","sourceRoot":"","sources":["../../../src/components/cura-calendar/cura-calendar.stories.tsx"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,IAAI,CAAC,EAAE,CAAC;;QAE3B,IAAI,CAAC,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,GAAG;QACxC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,CAAC,KAAK,GAAG;QACrC,IAAI,CAAC,QAAQ,IAAI,cAAc,IAAI,CAAC,QAAQ,GAAG;QAC/C,IAAI,CAAC,QAAQ,IAAI,cAAc,IAAI,CAAC,QAAQ,GAAG;QAC/C,IAAI,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,IAAI,GAAG;QAClC,IAAI,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,IAAI,GAAG;QAClC,IAAI,CAAC,UAAU,IAAI,gBAAgB,IAAI,CAAC,UAAU,GAAG;QACrD,IAAI,CAAC,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,GAAG;QACxC,WAAW,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG;QACzD,YAAY,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG;QAC5D,iBAAiB,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG;;QAEzF,IAAI,CAAC,gBAAgB,IAAI,uBAAuB,IAAI,CAAC,gBAAgB,GAAG;QACxE,IAAI,CAAC,kBAAkB,IAAI,yBAAyB,IAAI,CAAC,kBAAkB,GA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AE,IAAI,EAAE,cAAc,EAAE;YACjC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;YAC1B,WAAW,EAAE,2DAA2D;YACxE,KAAK,EAAE;gBACL,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;aACnC;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;YACZ,YAAY;SACb;QACD,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,OAAO;QACjB,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,YAAY;QACxB,WAAW,EAAE,CAAC,YAAY,CAAC;QAC3B,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,IAAI;QAChB,gBAAgB,EAAE,KAAK;QACvB,kBAAkB,EAAE,KAAK;QACzB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,IAAI;QACd,oBAAoB,EAAE,OAAO;KAC9B;CACF,CAAC","sourcesContent":["const renderCuraCalendar = args => `\n <cura-calendar\n ${args.period && `period=\"${args.period}\"`}\n ${args.width && `width=\"${args.width}\"`}\n ${args.maxWidth && `max-width=\"${args.maxWidth}\"`}\n ${args.minWidth && `min-width=\"${args.minWidth}\"`}\n ${args.mode && `mode=\"${args.mode}\"`}\n ${args.type && `type=\"${args.type}\"`}\n ${args.dateFormat && `date-format=\"${args.dateFormat}\"`}\n ${args.locale && `locale=\"${args.locale}\"`}\n ${`enable=\"${args.enable.length > 0 ? args.enable : '[]'}\"`}\n ${`disable=\"${args.disable.length > 0 ? args.disable : '[]'}\"`}\n ${`default-date='${args.defaultDate.length > 0 ? JSON.stringify(args.defaultDate) : '[]'}'`}\n\n ${args.disablePassDates && `disable-pass-dates=\"${args.disablePassDates}\"`}\n ${args.disableFutureDates && `disable-future-dates=\"${args.disableFutureDates}\"`}\n ${args.collapsed && `collapsed=\"${args.collapsed}\"`}\n ${args.floating && `floating=\"${args.floating}\"`}\n ${args.embedded && `embedded=\"${args.embedded}\"`}\n ${args.limitRange !== null ? `limit-range=\"${args.limitRange}\"` : ''}\n ${args.selectLabelColorMode && `select-label-color-mode=\"${args.selectLabelColorMode}\"`}\n ></cura-calendar>\n`;\n\nexport default {\n title: 'Componentes/Calendar/Calendar',\n tags: ['autodocs'],\n parameters: {\n layout: 'centered',\n },\n render: args => renderCuraCalendar(args),\n argTypes: {\n period: {\n control: 'array',\n description: 'Define os períodos disponíveis para o calendário. Quando não informado, considera todas as datas como habilitadas',\n table: {\n category: 'Properties',\n defaultValue: { summary: null },\n },\n },\n width: {\n control: 'text',\n description: 'Define a largura do calendário. <b>Largura minima \"268px\"</b>.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '268px' },\n },\n },\n maxWidth: {\n control: 'text',\n description: 'Define a largura máxima do calendário. <b>Largura máxima \"400px\"</b>.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '400px' },\n },\n },\n minWidth: {\n control: 'text',\n description: 'Define a largura mínima do calendário. <b>Largura mínima \"268px\"</b>.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '268px' },\n },\n },\n mode: {\n control: 'inline-radio',\n options: ['single', 'multiple', 'range'],\n description: 'Define o modo de seleção de datas.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'single' },\n },\n },\n type: {\n control: 'inline-radio',\n options: ['static', 'dropdown'],\n description: 'Define o tipo de visualização (mês/ano) do calendário.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'static' },\n },\n },\n dateFormat: {\n control: 'text',\n description: 'Define o formato das datas exibidas.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'yyyy-MM-dd' },\n },\n },\n locale: {\n control: 'inline-radio',\n options: ['pt-BR', 'en-US'],\n description: 'Define o idioma/localização do calendário.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'pt-BR' },\n },\n },\n defaultDate: {\n control: 'array',\n description: 'Define as datas que serão pré-selecionadas no calendário.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '[]' },\n },\n },\n enable: {\n control: 'array',\n description: 'Define as datas que são habilitadas para seleção.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '[]' },\n },\n },\n disable: {\n control: 'array',\n description: 'Define as datas que são desabilitadas para seleção.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '[]' },\n },\n },\n limitRange: {\n control: 'number',\n description: 'Define o limite de datas selecionáveis no modo de seleção range.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'null' },\n },\n },\n disablePassDates: {\n control: 'boolean',\n description: 'Define se as datas anteriores a data atual serão consideras como desabilitadas',\n table: {\n category: 'Properties',\n defaultValue: { summary: false },\n },\n },\n disableFutureDates: {\n control: 'boolean',\n description: 'Define se as datas futuras a data atual serão consideras como desabilitadas',\n table: {\n category: 'Properties',\n defaultValue: { summary: false },\n },\n },\n collapsed: {\n control: 'boolean',\n description: 'Define se a exibição do calendário será com recolhida ou expandida ',\n table: {\n category: 'Properties',\n defaultValue: { summary: null },\n },\n },\n floating: {\n control: 'boolean',\n description: 'Define se o componente é flutuante e aplica o sombreamento.',\n table: {\n category: 'Properties',\n defaultValue: { summary: true },\n },\n },\n embedded: {\n control: 'boolean',\n description: 'Define se o componente tenha borda, padding e sombra (box) ou não.',\n table: {\n category: 'Properties',\n defaultValue: { summary: true },\n },\n },\n selectLabelColorMode: {\n control: { type: 'inline-radio' },\n options: ['light', 'dark'],\n description: 'Define a cor do label do dia selecionado (light ou dark).',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'light' },\n },\n },\n },\n};\n\nexport const Calendar = {\n args: {\n period: [\n '2024-08-01',\n '2024-08-30',\n '2024-08-02',\n '2024-08-03',\n '2024-08-04',\n '2024-08-29',\n '2024-08-15',\n '2024-08-02',\n '2024-08-30',\n '2024-09-01',\n '2024-09-29',\n '2024-10-15',\n '2024-09-02',\n '2024-09-30',\n '2024-10-01',\n ],\n width: '280px',\n maxWidth: '400px',\n minWidth: '268px',\n mode: 'single',\n type: 'static',\n locale: 'pt-BR',\n dateFormat: 'yyyy-MM-dd',\n defaultDate: ['2024-08-15'],\n enable: [],\n disable: [],\n limitRange: null,\n disablePassDates: false,\n disableFutureDates: false,\n collapsed: null,\n floating: true,\n embedded: true,\n selectLabelColorMode: 'light',\n },\n};\n"]}
|
|
@@ -10,29 +10,23 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
const meta = {
|
|
14
14
|
title: 'Componentes/Card/Card',
|
|
15
15
|
tags: ['autodocs'],
|
|
16
16
|
render: (_a) => {
|
|
17
17
|
var { slot } = _a, args = __rest(_a, ["slot"]);
|
|
18
18
|
return `<cura-card ${args.hasPadding === true
|
|
19
|
-
? `
|
|
20
|
-
has-padding=${true}`
|
|
19
|
+
? `has-padding=${true}`
|
|
21
20
|
: `has-padding=${false}`}${args.hasShadow
|
|
22
|
-
? `
|
|
23
|
-
has-shadow="${args.hasShadow}"`
|
|
21
|
+
? ` has-shadow="${args.hasShadow}"`
|
|
24
22
|
: ''}${args.type
|
|
25
|
-
? `
|
|
26
|
-
type="${args.type}"`
|
|
23
|
+
? ` type="${args.type}"`
|
|
27
24
|
: ''}${args.colorMode
|
|
28
|
-
? `
|
|
29
|
-
color-mode="${args.colorMode}"`
|
|
25
|
+
? ` color-mode="${args.colorMode}"`
|
|
30
26
|
: ''}${args.href
|
|
31
|
-
? `
|
|
32
|
-
href="${args.href}"`
|
|
27
|
+
? ` href="${args.href}"`
|
|
33
28
|
: ''}${args.target
|
|
34
|
-
? `
|
|
35
|
-
target="${args.target}"`
|
|
29
|
+
? ` target="${args.target}"`
|
|
36
30
|
: ''}
|
|
37
31
|
>
|
|
38
32
|
${slot}
|
|
@@ -46,7 +40,8 @@ export default {
|
|
|
46
40
|
table: {
|
|
47
41
|
category: 'Properties',
|
|
48
42
|
defaultValue: { summary: 'true' },
|
|
49
|
-
|
|
43
|
+
type: { summary: 'boolean' }
|
|
44
|
+
}
|
|
50
45
|
},
|
|
51
46
|
hasShadow: {
|
|
52
47
|
name: 'has-shadow',
|
|
@@ -55,7 +50,8 @@ export default {
|
|
|
55
50
|
table: {
|
|
56
51
|
category: 'Properties',
|
|
57
52
|
defaultValue: { summary: 'false' },
|
|
58
|
-
|
|
53
|
+
type: { summary: 'boolean' }
|
|
54
|
+
}
|
|
59
55
|
},
|
|
60
56
|
type: {
|
|
61
57
|
control: { type: 'inline-radio' },
|
|
@@ -64,7 +60,8 @@ export default {
|
|
|
64
60
|
table: {
|
|
65
61
|
category: 'Properties',
|
|
66
62
|
defaultValue: { summary: 'solid' },
|
|
67
|
-
|
|
63
|
+
type: { summary: '"solid" | "transparent"' }
|
|
64
|
+
}
|
|
68
65
|
},
|
|
69
66
|
href: {
|
|
70
67
|
control: 'text',
|
|
@@ -72,7 +69,8 @@ export default {
|
|
|
72
69
|
name: 'href',
|
|
73
70
|
table: {
|
|
74
71
|
category: 'Properties Card Link',
|
|
75
|
-
|
|
72
|
+
type: { summary: 'string' }
|
|
73
|
+
}
|
|
76
74
|
},
|
|
77
75
|
target: {
|
|
78
76
|
control: 'text',
|
|
@@ -81,17 +79,19 @@ export default {
|
|
|
81
79
|
table: {
|
|
82
80
|
category: 'Properties Card Link',
|
|
83
81
|
defaultValue: { summary: '_self' },
|
|
84
|
-
|
|
82
|
+
type: { summary: 'string' }
|
|
83
|
+
}
|
|
85
84
|
},
|
|
86
85
|
colorMode: {
|
|
87
86
|
control: { type: 'inline-radio' },
|
|
88
87
|
options: ['light', 'dark'],
|
|
89
|
-
description: 'Se houver um href definido, muda a
|
|
88
|
+
description: 'Se houver um href definido, muda a cor de fundo do card (light ou dark).',
|
|
90
89
|
table: {
|
|
91
90
|
category: 'Properties Card Link',
|
|
92
91
|
defaultValue: { summary: 'light' },
|
|
92
|
+
type: { summary: '"light" | "dark"' }
|
|
93
93
|
},
|
|
94
|
-
name: 'color-mode'
|
|
94
|
+
name: 'color-mode'
|
|
95
95
|
},
|
|
96
96
|
slot: {
|
|
97
97
|
name: 'content',
|
|
@@ -99,11 +99,20 @@ export default {
|
|
|
99
99
|
description: 'Conteúdo a ser exibido dentro do card. Aceita tags HTML.',
|
|
100
100
|
table: {
|
|
101
101
|
category: 'Slot',
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
type: { summary: 'HTML' }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
104
105
|
},
|
|
106
|
+
parameters: {
|
|
107
|
+
docs: {
|
|
108
|
+
description: {
|
|
109
|
+
component: 'O componente Card é utilizado para agrupar conteúdo relacionado em um container visual.'
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
105
113
|
};
|
|
106
|
-
export
|
|
114
|
+
export default meta;
|
|
115
|
+
export const Default = {
|
|
107
116
|
args: {
|
|
108
117
|
hasPadding: true,
|
|
109
118
|
hasShadow: true,
|
|
@@ -121,7 +130,29 @@ export const CuraCard = {
|
|
|
121
130
|
height: 30px;
|
|
122
131
|
color: #9b51e0;">
|
|
123
132
|
contentArea
|
|
124
|
-
</div
|
|
125
|
-
}
|
|
133
|
+
</div>`
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
export const WithLink = {
|
|
137
|
+
args: Object.assign(Object.assign({}, Default.args), { href: 'https://example.com', target: '_blank', slot: `<div
|
|
138
|
+
style="display:flex;
|
|
139
|
+
justify-content: center;
|
|
140
|
+
align-items: center;
|
|
141
|
+
align-self: stretch;
|
|
142
|
+
text-align: center;
|
|
143
|
+
height: 30px;">
|
|
144
|
+
Card com Link
|
|
145
|
+
</div>` })
|
|
146
|
+
};
|
|
147
|
+
export const Transparent = {
|
|
148
|
+
args: Object.assign(Object.assign({}, Default.args), { type: 'transparent', hasShadow: false, slot: `<div
|
|
149
|
+
style="display:flex;
|
|
150
|
+
justify-content: center;
|
|
151
|
+
align-items: center;
|
|
152
|
+
align-self: stretch;
|
|
153
|
+
text-align: center;
|
|
154
|
+
height: 30px;">
|
|
155
|
+
Card Transparente
|
|
156
|
+
</div>` })
|
|
126
157
|
};
|
|
127
158
|
//# sourceMappingURL=cura-card.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-card.stories.js","sourceRoot":"","sources":["../../../src/components/cura-card/cura-card.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"cura-card.stories.js","sourceRoot":"","sources":["../../../src/components/cura-card/cura-card.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAEA,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,MAAM,EAAE,CAAC,EAAiB,EAAE,EAAE;YAArB,EAAE,IAAI,OAAW,EAAN,IAAI,cAAf,QAAiB,CAAF;QACtB,OAAO,cACL,IAAI,CAAC,UAAU,KAAK,IAAI;YACtB,CAAC,CAAC,eAAe,IAAI,EAAE;YACvB,CAAC,CAAC,eAAe,KAAK,EAC1B,GACE,IAAI,CAAC,SAAS;YACZ,CAAC,CAAC,gBAAgB,IAAI,CAAC,SAAS,GAAG;YACnC,CAAC,CAAC,EACN,GACE,IAAI,CAAC,IAAI;YACP,CAAC,CAAC,UAAU,IAAI,CAAC,IAAI,GAAG;YACxB,CAAC,CAAC,EACN,GACE,IAAI,CAAC,SAAS;YACZ,CAAC,CAAC,gBAAgB,IAAI,CAAC,SAAS,GAAG;YACnC,CAAC,CAAC,EACN,GACE,IAAI,CAAC,IAAI;YACP,CAAC,CAA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I,EAAE;;;;;;;;WAQC,GACR;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAU;IAChC,IAAI,kCACC,OAAO,CAAC,IAAI,KACf,IAAI,EAAE,aAAa,EACnB,SAAS,EAAE,KAAK,EAChB,IAAI,EAAE;;;;;;;;WAQC,GACR;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/html';\n\nconst meta: Meta = {\n title: 'Componentes/Card/Card',\n tags: ['autodocs'],\n render: ({ slot, ...args }) => {\n return `<cura-card ${\n args.hasPadding === true\n ? `has-padding=${true}`\n : `has-padding=${false}`\n }${\n args.hasShadow\n ? ` has-shadow=\"${args.hasShadow}\"`\n : ''\n }${\n args.type\n ? ` type=\"${args.type}\"`\n : ''\n }${\n args.colorMode\n ? ` color-mode=\"${args.colorMode}\"`\n : ''\n }${\n args.href\n ? ` href=\"${args.href}\"`\n : ''\n }${\n args.target\n ? ` target=\"${args.target}\"`\n : ''\n }\n>\n ${slot}\n</cura-card>`;\n },\n argTypes: {\n hasPadding: {\n name: 'has-padding',\n control: 'boolean',\n description: 'Adiciona padding ao card.',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'true' },\n type: { summary: 'boolean' }\n }\n },\n hasShadow: {\n name: 'has-shadow',\n control: 'boolean',\n description: 'Adiciona sombra ao card. No modo transparent o card não possui shadow',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'false' },\n type: { summary: 'boolean' }\n }\n },\n type: {\n control: { type: 'inline-radio' },\n options: ['solid', 'transparent'],\n description: 'Tipo do card (solid ou transparent).',\n table: {\n category: 'Properties',\n defaultValue: { summary: 'solid' },\n type: { summary: '\"solid\" | \"transparent\"' }\n }\n },\n href: {\n control: 'text',\n description: 'Se definido, o elemento de ação renderizado internamente será um link e o card terá um estilo de card link',\n name: 'href',\n table: {\n category: 'Properties Card Link',\n type: { summary: 'string' }\n }\n },\n target: {\n control: 'text',\n description: 'Se houver um href definido, define o comportamento de abertura do link.',\n name: 'target',\n table: {\n category: 'Properties Card Link',\n defaultValue: { summary: '_self' },\n type: { summary: 'string' }\n }\n },\n colorMode: {\n control: { type: 'inline-radio' },\n options: ['light', 'dark'],\n description: 'Se houver um href definido, muda a cor de fundo do card (light ou dark).',\n table: {\n category: 'Properties Card Link',\n defaultValue: { summary: 'light' },\n type: { summary: '\"light\" | \"dark\"' }\n },\n name: 'color-mode'\n },\n slot: {\n name: 'content',\n control: 'text',\n description: 'Conteúdo a ser exibido dentro do card. Aceita tags HTML.',\n table: {\n category: 'Slot',\n type: { summary: 'HTML' }\n }\n }\n },\n parameters: {\n docs: {\n description: {\n component: 'O componente Card é utilizado para agrupar conteúdo relacionado em um container visual.'\n }\n }\n }\n};\n\nexport default meta;\n\ntype Story = StoryObj;\n\nexport const Default: Story = {\n args: {\n hasPadding: true,\n hasShadow: true,\n type: 'solid',\n colorMode: 'light',\n target: '_self',\n href: '',\n slot: `<div\n style=\"display:flex;\n justify-content: center;\n align-items: center;\n align-self: stretch;\n background-color:rgba(187, 107, 217, 0.4);\n text-align: center;\n height: 30px;\n color: #9b51e0;\">\n contentArea\n </div>`\n }\n};\n\nexport const WithLink: Story = {\n args: {\n ...Default.args,\n href: 'https://example.com',\n target: '_blank',\n slot: `<div\n style=\"display:flex;\n justify-content: center;\n align-items: center;\n align-self: stretch;\n text-align: center;\n height: 30px;\">\n Card com Link\n </div>`\n }\n};\n\nexport const Transparent: Story = {\n args: {\n ...Default.args,\n type: 'transparent',\n hasShadow: false,\n slot: `<div\n style=\"display:flex;\n justify-content: center;\n align-items: center;\n align-self: stretch;\n text-align: center;\n height: 30px;\">\n Card Transparente\n </div>`\n }\n};\n"]}
|
|
@@ -142,8 +142,13 @@ export class CuraDropdownSearch {
|
|
|
142
142
|
setTimeout(() => this.getSlotElements(), 10);
|
|
143
143
|
}
|
|
144
144
|
disconnectedCallback() {
|
|
145
|
+
this.removeAllListeners();
|
|
146
|
+
}
|
|
147
|
+
removeAllListeners() {
|
|
145
148
|
window === null || window === void 0 ? void 0 : window.removeEventListener('resize', this.handleWindowResize);
|
|
146
149
|
window === null || window === void 0 ? void 0 : window.removeEventListener('orientationchange', this.handleWindowResize);
|
|
150
|
+
this.host.removeEventListener('actionclick', this.handleOptionActionClick);
|
|
151
|
+
this.host.removeEventListener('selectoption', this.handleSelectOption);
|
|
147
152
|
}
|
|
148
153
|
moveHighlight(direction) {
|
|
149
154
|
if (!this.dropdownSelectableItems.length)
|
|
@@ -265,7 +270,7 @@ export class CuraDropdownSearch {
|
|
|
265
270
|
};
|
|
266
271
|
}
|
|
267
272
|
render() {
|
|
268
|
-
return (h(Host, { key: '
|
|
273
|
+
return (h(Host, { key: 'e56264957327983c9a06eefe7f723b17d241c477', style: this.getHostCSSProperties() }, h("div", { key: '311a1facd2b0e9366f00b47e35bbcaa3d2a754dd', class: this.getClasses(), style: this.styles }, h("div", { key: 'd6f5345eaea63036c6855ee778ec1edefa5d20f7', class: "component-controls" }, this.isMobile && this.zoomState ? (h("cura-button-transparent", { fontColor: "dark", onClick: () => this.handleBackClick(), iconName: "arrowLeft", size: "large", iconOnly: true, color: "primary", id: "button-back" })) : '', h("cura-input-text", { key: '07887def77a37d0cd8ca9f3f044024cb07dbca9e', disabled: this.disabled, label: this.label, part: "cura-input-field", mode: this.zoomState ? 'transparent' : 'default', required: this.required, iconName: this.icon || 'search', value: this.value, status: this.status, onValueChange: (ev) => this.handleInputValueChange(ev), onInput: (ev) => this._preventEvent(ev), onFocus: () => this.handleFocus(), onClick: (ev) => this._preventEvent(ev), onBlur: () => this.handleBlur(), onFocusout: () => this.handleFocusout(), onInputClear: (ev) => this.handleInputClear(ev), placeholder: this.placeholder, size: this.size, onKeyDown: (ev) => this.handleKeyDown(ev) }, h("slot", { key: 'e55d3c7ad869262f7663e85c6c12ccaeef66f9d0', name: "helperText" }))), h("div", { key: 'bd2ee09236489e4b8652b7e87ffd248967c372e9', class: "dropdown-container", onMouseOver: () => this.handleDropdownMouseOver() }, h("slot", { key: 'a15f32c8fc3d9646f84f3e9a25ab32a353e0b194', onSlotchange: () => this.handleSlotChange() })))));
|
|
269
274
|
}
|
|
270
275
|
static get is() { return "cura-dropdown-search"; }
|
|
271
276
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-dropdown-search.js","sourceRoot":"","sources":["../../../src/components/cura-dropdown-search/cura-dropdown-search.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAOpF,MAAM,OAAO,kBAAkB;;QAwF7B,oBAAe,GAAG,EAAE,CAAC;QAErB,mBAAc,GAAG,GAAG,CAAC;QAErB,kBAAa,GAAG,GAAG,CAAC;QAMpB,qBAAgB,GAAW,CAAC,CAAC,CAAC;QAE9B,4BAAuB,GAAG,EAAE,CAAC;QAkC7B,qBAAgB,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAA;QAEpD,uBAAkB,GAAG,GAAG,EAAE;YACxB,IAAI,IAAI,CAAC,aAAa;gBAAE,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACzD,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;gBACnC,IAAI,CAAC,QAAQ,GAAG,WAAW,EAAE,CAAC;gBAC9B,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC3B,CAAC,CAAA;QAED,gBAAW,GAAG,GAAG,EAAE;YACjB,IAAI,IAAI,CAAC,YAAY;gBAAE,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC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AAE,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;wBAE1C,6DAAM,IAAI,EAAC,YAAY,GAAQ,CACf,CACd;gBACN,4DAAK,KAAK,EAAC,oBAAoB,EAAC,WAAW,EAAG,GAAG,EAAE,CAAC,IAAI,CAAC,uBAAuB,EAAE;oBAChF,6DAAM,YAAY,EAAG,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,GAAU,CACxD,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, Element, State, Method, Event, EventEmitter } from '@stencil/core';\nimport { checkMobile, checkIOS } from '../../utils/utils';\nimport { FixedElementScrollBehavior } from '../../utils/FixedElementScrollBehavior';\n\n@Component({\n tag: 'cura-dropdown-search',\n styleUrl: 'cura-dropdown-search.scss',\n shadow: true,\n})\nexport class CuraDropdownSearch {\n @Element() host: HTMLElement;\n /**\n * Name of the field.\n * Required.\n */\n @Prop({ reflect: true }) name!: string;\n /**\n * Size of the dropdown search component\n * Values: 'small', 'medium' or 'large' (default).\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' | string = 'large';\n /**\n * Define component status.\n * Values: 'error' or 'default'.\n */\n @Prop({ reflect: true, mutable: true }) status: 'error' | 'default' | string = 'default';\n /**\n * Disabled state. Default: false.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n /**\n * Field is required. Default: false.\n */\n @Prop({ reflect: true }) required: boolean = false;\n /**\n * The placeholder text.\n */\n @Prop({ reflect: true }) placeholder: string = '';\n /**\n * The label.\n */\n @Prop({ reflect: true }) label: string = '';\n /**\n * Custom icon name. Default: search.\n */\n @Prop({ reflect: true }) icon: string = 'search';\n /**\n * CSS max-height property for dropdown item.\n * Can also be used by css property --max-height.\n * Default: 400px\n */\n @Prop({ reflect: true }) maxheight: string = '400px';\n /**\n * Readonly property value.\n * Represents the term on the search input field.\n */\n @Prop({ mutable: true }) value: string = '';\n /**\n * Delay in milliseconds to dispatch search events.\n * Default: 400\n */\n @Prop({ reflect: true }) searchdelay: number = 400;\n /**\n * Min chars to dispatch search events.\n * Default: 3\n */\n @Prop({ reflect: true }) searchminchars: number = 3;\n\n /**\n * Set focus to input field.\n */\n @Method()\n async setFocus() {\n this.getInputElement().setFocus();\n }\n /**\n * Select by optionid property of a selectable option component.\n */\n @Method()\n async selectOption(optionid: string) {\n this._selectOption(optionid);\n }\n\n @Event() termchange: EventEmitter<string>;\n @Event() optionselect: EventEmitter<string>;\n\n @State() styles = {};\n @State() zoomState = false;\n @State() isOnFocus: boolean = false;\n\n scrollBehavior: FixedElementScrollBehavior;\n\n weights: any;\n breakpoints: any;\n isMobile: boolean;\n\n resizeTimeout: any;\n resizeTimeoutMs = 66;\n focusTimeout: any;\n focusTimeoutMs = 300;\n blurTimeout: any;\n blurTimeoutMs = 300;\n valueTimeout: any;\n\n dropdownElement: HTMLDivElement;\n selectedOptionElement: any;\n highlightedElement: any;\n highlightedIndex: number = -1;\n @State() dropdownItems = [];\n dropdownSelectableItems = [];\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.breakpoints = window.CuraAPI.theme.breakpoints.get();\n this.styles['--info'] = window.CuraAPI.theme.colors.getColor('info-base');\n this.styles['--purewhite'] = window.CuraAPI.theme.colors.getColor('neutral-purewhite');\n this.styles['--neutral-light'] = window.CuraAPI.theme.colors.getColor('neutral-light');\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor('neutral-dark');\n this.styles['--neutral-black-shadow'] = window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16);\n this.styles['--error-dark'] = window.CuraAPI.theme.colors.getColor('error-dark');\n this.styles['--error-lighter'] = window.CuraAPI.theme.colors.getColor('error-lighter');\n this.styles['--primary'] = window.CuraAPI.theme.colors.getColor('primary');\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n window?.addEventListener('resize', this.handleWindowResize);\n window?.addEventListener('orientationchange', this.handleWindowResize);\n this.isMobile = checkMobile();\n }\n\n componentDidLoad() {\n this.dropdownElement = this.host.shadowRoot?.querySelector('.dropdown-container');\n this.host.addEventListener('actionclick', this.handleOptionActionClick);\n this.host.addEventListener('selectoption', this.handleSelectOption);\n this.scrollBehavior = new FixedElementScrollBehavior(this.host, this.dropdownElement);\n setTimeout(() => this.getSlotElements(), 10);\n }\n\n disconnectedCallback() {\n window?.removeEventListener('resize', this.handleWindowResize);\n window?.removeEventListener('orientationchange', this.handleWindowResize);\n }\n\n handleSlotChange = () => { this.getSlotElements(); }\n\n handleWindowResize = () => {\n if (this.resizeTimeout) clearTimeout(this.resizeTimeout);\n this.resizeTimeout = setTimeout(() => {\n this.isMobile = checkMobile();\n this.setZoomHeight();\n }, this.resizeTimeoutMs);\n }\n\n handleFocus = () => {\n if (this.focusTimeout) clearTimeout(this.focusTimeout);\n this.focusTimeout = setTimeout(() => {\n this.isOnFocus = true;\n this.clearHighlight();\n if (this.isMobile && !this.zoomState) this.enterZoom();\n if (this.zoomState) this.setZoomHeight();\n setTimeout(() => {\n this.selectedOptionElement?.scrollIntoView({behavior: 'instant', block: 'nearest', inline: 'nearest'});\n }, 10);\n }, this.focusTimeoutMs);\n }\n\n handleBlur = () => {\n if (this.blurTimeout) clearTimeout(this.blurTimeout);\n this.blurTimeout = setTimeout(() => {\n if (this.zoomState) {\n const delay = checkIOS ? 500 : 100;\n setTimeout(() => this.setZoomHeight(), delay);\n }\n this.isOnFocus = false;\n }, this.blurTimeoutMs);\n }\n\n handleFocusout = () => {\n if( this.zoomState ) this.setZoomHeight();\n }\n\n handleBackClick = () => { this.exitZoom(); }\n\n handleOptionActionClick = (ev: CustomEvent) => {\n this.getInputElement().setFocus();\n this._preventEvent(ev);\n }\n\n handleInputClear = (ev: CustomEvent) => {\n this.setValue('');\n this.clearSelectedOptions();\n this._preventEvent(ev);\n }\n\n handleSelectOption = (ev: CustomEvent) => {\n this._selectOption(ev.detail);\n this._preventEvent(ev);\n }\n\n handleInputValueChange = (ev: CustomEvent) => {\n this.setValue(ev.detail);\n if( this.selectedOptionElement && ev.detail !== this.selectedOptionElement.value) {\n this.clearSelectedOptions();\n }\n this._preventEvent(ev);\n }\n\n handleDropdownMouseOver = () => {\n if( this.highlightedElement || this.highlightedIndex >= 0 ) this.clearHighlight();\n }\n\n handleKeyDown = (ev: KeyboardEvent) => {\n if( ev.key === 'ArrowDown' ) this.moveHighlight('next');\n if( ev.key === 'ArrowUp' ) this.moveHighlight('prev');\n if( ev.key === 'Enter' ) this.selectHighlight();\n }\n\n moveHighlight(direction: 'next' | 'prev') {\n if (!this.dropdownSelectableItems.length) return;\n let position = direction === 'next' ? this.highlightedIndex + 1 : this.highlightedIndex - 1;\n if( position < 0) {\n this.clearHighlight();\n return;\n }\n const selectableItemsLastPosition = this.dropdownSelectableItems.length - 1;\n if( position > selectableItemsLastPosition ) position = selectableItemsLastPosition;\n if( this.highlightedElement ) this.highlightedElement.highlighted = false;\n this.highlightedIndex = position;\n this.highlightedElement = this.dropdownSelectableItems[position];\n if( this.highlightedElement.selected ) {\n this.moveHighlight(direction);\n return;\n }\n this.highlightedElement.highlighted = true;\n this.highlightedElement.scrollIntoView({behavior: 'instant', block: 'nearest', inline: 'nearest' });\n }\n\n clearHighlight() {\n if( this.highlightedElement ) {\n this.highlightedElement.highlighted = false;\n this.highlightedElement = null;\n }\n this.highlightedIndex = -1;\n }\n\n selectHighlight() {\n if( this.highlightedElement ) {\n this._selectOption(this.highlightedElement.optionid);\n this.clearHighlight();\n this.getInputElement().blur();\n }\n }\n\n setValue(value: string) {\n if (this.value !== value) {\n this.value = value;\n if( this.valueTimeout) clearTimeout(this.valueTimeout);\n this.valueTimeout = setTimeout(() => {\n this.termchange.emit(this.value === '' || this.value.length < this.searchminchars ? '' : this.value);\n }, this.searchdelay || 300);\n }\n }\n\n _selectOption(optionid: string) {\n if (!optionid) {\n this.clearSelectedOptions();\n this.setValue('');\n return;\n }\n const optionElement = this.dropdownSelectableItems.find(option => option.optionid === optionid);\n if( optionElement && !optionElement.selected ) {\n this.clearSelectedOptions();\n this.selectedOptionElement = optionElement;\n this.selectedOptionElement.selected = true;\n this.setValue(this.selectedOptionElement.value);\n this.optionselect.emit(this.selectedOptionElement.optionid);\n if (this.zoomState) setTimeout(() => this.exitZoom(), this.blurTimeoutMs);\n }\n }\n\n clearSelectedOptions() {\n this.dropdownSelectableItems.forEach(option => {\n if( option.selected ) option.selected = false;\n });\n this.selectedOptionElement = null;\n }\n\n getSlotElements() {\n const elements = [];\n const selectable = [];\n let hasNotFound = false;\n if( this.dropdownElement ) {\n this.dropdownElement\n .querySelector('slot')\n .assignedElements()\n .forEach(item => {\n elements.push(item);\n if( item.localName === 'cura-dropdown-search-option' && item[\"selectable\"] ) selectable.push(item);\n if( item.localName === 'cura-dropdown-search-not-found' ) hasNotFound = true;\n });\n }\n this.dropdownSelectableItems = selectable;\n this.dropdownItems = elements;\n this.status = hasNotFound ? 'error' : 'default';\n }\n\n\n enterZoom() {\n this.scrollBehavior.disableScroll();\n this.setZoomHeight();\n this.zoomState = true;\n }\n\n exitZoom() {\n this.scrollBehavior.enableScroll();\n this.setZoomHeight();\n setTimeout(() => { this.zoomState = false}, 300);\n }\n\n getInputElement = () => this.host.shadowRoot?.querySelector('cura-input-text');\n\n setZoomHeight() {\n const h = window ? `${window.visualViewport?.height || window.innerHeight}px` : '100vh';\n this.styles = { ...this.styles, '--height': h };\n }\n\n getClasses() {\n return {\n \"component-container\": true,\n \"mobile\": this.isMobile,\n \"zoom\": this.zoomState,\n \"dropdown-visible\": this.isOnFocus && (this.dropdownItems.length > 0 && !this.zoomState),\n \"error\": this.status === 'error'\n }\n }\n\n _preventEvent = (ev: Event) => {\n ev.preventDefault();\n ev.stopPropagation();\n }\n\n getHostCSSProperties() {\n return {\n '--max-height': this.maxheight || '400px'\n };\n }\n\n render() {\n return (\n <Host style={ this.getHostCSSProperties() }>\n <div class={ this.getClasses() } style={ this.styles }>\n <div class=\"component-controls\">\n { this.isMobile && this.zoomState ? (\n <cura-button-transparent\n fontColor=\"dark\"\n onClick={ () => this.handleBackClick() }\n iconName=\"arrowLeft\"\n size=\"large\"\n iconOnly\n color=\"primary\"\n id=\"button-back\">\n </cura-button-transparent>\n ) : '' }\n <cura-input-text\n disabled={ this.disabled }\n label={ this.label }\n part=\"cura-input-field\"\n mode={ this.zoomState ? 'transparent' : 'default' }\n required={ this.required }\n iconName={ this.icon || 'search' }\n value={ this.value }\n status={ this.status }\n onValueChange={ (ev) => this.handleInputValueChange(ev) }\n onInput={ (ev) => this._preventEvent(ev) }\n onFocus={ () => this.handleFocus() }\n onClick={ (ev) => this._preventEvent(ev) }\n onBlur={ () => this.handleBlur() }\n onFocusout={ () => this.handleFocusout() }\n onInputClear={ (ev) => this.handleInputClear(ev) }\n placeholder={ this.placeholder }\n size={ this.size }\n onKeyDown={ (ev) => this.handleKeyDown(ev) }\n >\n <slot name=\"helperText\"></slot>\n </cura-input-text>\n </div>\n <div class=\"dropdown-container\" onMouseOver={ () => this.handleDropdownMouseOver() }>\n <slot onSlotchange={ () => this.handleSlotChange() }></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cura-dropdown-search.js","sourceRoot":"","sources":["../../../src/components/cura-dropdown-search/cura-dropdown-search.t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C,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;wBAE1C,6DAAM,IAAI,EAAC,YAAY,GAAQ,CACf,CACd;gBACN,4DAAK,KAAK,EAAC,oBAAoB,EAAC,WAAW,EAAG,GAAG,EAAE,CAAC,IAAI,CAAC,uBAAuB,EAAE;oBAChF,6DAAM,YAAY,EAAG,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,GAAU,CACxD,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, Element, State, Method, Event, EventEmitter } from '@stencil/core';\nimport { checkMobile, checkIOS } from '../../utils/utils';\nimport { FixedElementScrollBehavior } from '../../utils/FixedElementScrollBehavior';\n\n@Component({\n tag: 'cura-dropdown-search',\n styleUrl: 'cura-dropdown-search.scss',\n shadow: true,\n})\nexport class CuraDropdownSearch {\n @Element() host: HTMLElement;\n /**\n * Name of the field.\n * Required.\n */\n @Prop({ reflect: true }) name!: string;\n /**\n * Size of the dropdown search component\n * Values: 'small', 'medium' or 'large' (default).\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' | string = 'large';\n /**\n * Define component status.\n * Values: 'error' or 'default'.\n */\n @Prop({ reflect: true, mutable: true }) status: 'error' | 'default' | string = 'default';\n /**\n * Disabled state. Default: false.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n /**\n * Field is required. Default: false.\n */\n @Prop({ reflect: true }) required: boolean = false;\n /**\n * The placeholder text.\n */\n @Prop({ reflect: true }) placeholder: string = '';\n /**\n * The label.\n */\n @Prop({ reflect: true }) label: string = '';\n /**\n * Custom icon name. Default: search.\n */\n @Prop({ reflect: true }) icon: string = 'search';\n /**\n * CSS max-height property for dropdown item.\n * Can also be used by css property --max-height.\n * Default: 400px\n */\n @Prop({ reflect: true }) maxheight: string = '400px';\n /**\n * Readonly property value.\n * Represents the term on the search input field.\n */\n @Prop({ mutable: true }) value: string = '';\n /**\n * Delay in milliseconds to dispatch search events.\n * Default: 400\n */\n @Prop({ reflect: true }) searchdelay: number = 400;\n /**\n * Min chars to dispatch search events.\n * Default: 3\n */\n @Prop({ reflect: true }) searchminchars: number = 3;\n\n /**\n * Set focus to input field.\n */\n @Method()\n async setFocus() {\n this.getInputElement().setFocus();\n }\n /**\n * Select by optionid property of a selectable option component.\n */\n @Method()\n async selectOption(optionid: string) {\n this._selectOption(optionid);\n }\n\n @Event() termchange: EventEmitter<string>;\n @Event() optionselect: EventEmitter<string>;\n\n @State() styles = {};\n @State() zoomState = false;\n @State() isOnFocus: boolean = false;\n\n scrollBehavior: FixedElementScrollBehavior;\n\n weights: any;\n breakpoints: any;\n isMobile: boolean;\n\n resizeTimeout: any;\n resizeTimeoutMs = 66;\n focusTimeout: any;\n focusTimeoutMs = 300;\n blurTimeout: any;\n blurTimeoutMs = 300;\n valueTimeout: any;\n\n dropdownElement: HTMLDivElement;\n selectedOptionElement: any;\n highlightedElement: any;\n highlightedIndex: number = -1;\n @State() dropdownItems = [];\n dropdownSelectableItems = [];\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.breakpoints = window.CuraAPI.theme.breakpoints.get();\n this.styles['--info'] = window.CuraAPI.theme.colors.getColor('info-base');\n this.styles['--purewhite'] = window.CuraAPI.theme.colors.getColor('neutral-purewhite');\n this.styles['--neutral-light'] = window.CuraAPI.theme.colors.getColor('neutral-light');\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor('neutral-dark');\n this.styles['--neutral-black-shadow'] = window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16);\n this.styles['--error-dark'] = window.CuraAPI.theme.colors.getColor('error-dark');\n this.styles['--error-lighter'] = window.CuraAPI.theme.colors.getColor('error-lighter');\n this.styles['--primary'] = window.CuraAPI.theme.colors.getColor('primary');\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n window?.addEventListener('resize', this.handleWindowResize);\n window?.addEventListener('orientationchange', this.handleWindowResize);\n this.isMobile = checkMobile();\n }\n\n componentDidLoad() {\n this.dropdownElement = this.host.shadowRoot?.querySelector('.dropdown-container');\n this.host.addEventListener('actionclick', this.handleOptionActionClick);\n this.host.addEventListener('selectoption', this.handleSelectOption);\n this.scrollBehavior = new FixedElementScrollBehavior(this.host, this.dropdownElement);\n setTimeout(() => this.getSlotElements(), 10);\n }\n\n disconnectedCallback() {\n this.removeAllListeners();\n }\n\n removeAllListeners() {\n window?.removeEventListener('resize', this.handleWindowResize);\n window?.removeEventListener('orientationchange', this.handleWindowResize);\n this.host.removeEventListener('actionclick', this.handleOptionActionClick);\n this.host.removeEventListener('selectoption', this.handleSelectOption);\n }\n\n handleSlotChange = () => { this.getSlotElements(); }\n\n handleWindowResize = () => {\n if (this.resizeTimeout) clearTimeout(this.resizeTimeout);\n this.resizeTimeout = setTimeout(() => {\n this.isMobile = checkMobile();\n this.setZoomHeight();\n }, this.resizeTimeoutMs);\n }\n\n handleFocus = () => {\n if (this.focusTimeout) clearTimeout(this.focusTimeout);\n this.focusTimeout = setTimeout(() => {\n this.isOnFocus = true;\n this.clearHighlight();\n if (this.isMobile && !this.zoomState) this.enterZoom();\n if (this.zoomState) this.setZoomHeight();\n setTimeout(() => {\n this.selectedOptionElement?.scrollIntoView({behavior: 'instant', block: 'nearest', inline: 'nearest'});\n }, 10);\n }, this.focusTimeoutMs);\n }\n\n handleBlur = () => {\n if (this.blurTimeout) clearTimeout(this.blurTimeout);\n this.blurTimeout = setTimeout(() => {\n if (this.zoomState) {\n const delay = checkIOS ? 500 : 100;\n setTimeout(() => this.setZoomHeight(), delay);\n }\n this.isOnFocus = false;\n }, this.blurTimeoutMs);\n }\n\n handleFocusout = () => {\n if( this.zoomState ) this.setZoomHeight();\n }\n\n handleBackClick = () => { this.exitZoom(); }\n\n handleOptionActionClick = (ev: CustomEvent) => {\n this.getInputElement().setFocus();\n this._preventEvent(ev);\n }\n\n handleInputClear = (ev: CustomEvent) => {\n this.setValue('');\n this.clearSelectedOptions();\n this._preventEvent(ev);\n }\n\n handleSelectOption = (ev: CustomEvent) => {\n this._selectOption(ev.detail);\n this._preventEvent(ev);\n }\n\n handleInputValueChange = (ev: CustomEvent) => {\n this.setValue(ev.detail);\n if( this.selectedOptionElement && ev.detail !== this.selectedOptionElement.value) {\n this.clearSelectedOptions();\n }\n this._preventEvent(ev);\n }\n\n handleDropdownMouseOver = () => {\n if( this.highlightedElement || this.highlightedIndex >= 0 ) this.clearHighlight();\n }\n\n handleKeyDown = (ev: KeyboardEvent) => {\n if( ev.key === 'ArrowDown' ) this.moveHighlight('next');\n if( ev.key === 'ArrowUp' ) this.moveHighlight('prev');\n if( ev.key === 'Enter' ) this.selectHighlight();\n }\n\n moveHighlight(direction: 'next' | 'prev') {\n if (!this.dropdownSelectableItems.length) return;\n let position = direction === 'next' ? this.highlightedIndex + 1 : this.highlightedIndex - 1;\n if( position < 0) {\n this.clearHighlight();\n return;\n }\n const selectableItemsLastPosition = this.dropdownSelectableItems.length - 1;\n if( position > selectableItemsLastPosition ) position = selectableItemsLastPosition;\n if( this.highlightedElement ) this.highlightedElement.highlighted = false;\n this.highlightedIndex = position;\n this.highlightedElement = this.dropdownSelectableItems[position];\n if( this.highlightedElement.selected ) {\n this.moveHighlight(direction);\n return;\n }\n this.highlightedElement.highlighted = true;\n this.highlightedElement.scrollIntoView({behavior: 'instant', block: 'nearest', inline: 'nearest' });\n }\n\n clearHighlight() {\n if( this.highlightedElement ) {\n this.highlightedElement.highlighted = false;\n this.highlightedElement = null;\n }\n this.highlightedIndex = -1;\n }\n\n selectHighlight() {\n if( this.highlightedElement ) {\n this._selectOption(this.highlightedElement.optionid);\n this.clearHighlight();\n this.getInputElement().blur();\n }\n }\n\n setValue(value: string) {\n if (this.value !== value) {\n this.value = value;\n if( this.valueTimeout) clearTimeout(this.valueTimeout);\n this.valueTimeout = setTimeout(() => {\n this.termchange.emit(this.value === '' || this.value.length < this.searchminchars ? '' : this.value);\n }, this.searchdelay || 300);\n }\n }\n\n _selectOption(optionid: string) {\n if (!optionid) {\n this.clearSelectedOptions();\n this.setValue('');\n return;\n }\n const optionElement = this.dropdownSelectableItems.find(option => option.optionid === optionid);\n if( optionElement && !optionElement.selected ) {\n this.clearSelectedOptions();\n this.selectedOptionElement = optionElement;\n this.selectedOptionElement.selected = true;\n this.setValue(this.selectedOptionElement.value);\n this.optionselect.emit(this.selectedOptionElement.optionid);\n if (this.zoomState) setTimeout(() => this.exitZoom(), this.blurTimeoutMs);\n }\n }\n\n clearSelectedOptions() {\n this.dropdownSelectableItems.forEach(option => {\n if( option.selected ) option.selected = false;\n });\n this.selectedOptionElement = null;\n }\n\n getSlotElements() {\n const elements = [];\n const selectable = [];\n let hasNotFound = false;\n if( this.dropdownElement ) {\n this.dropdownElement\n .querySelector('slot')\n .assignedElements()\n .forEach(item => {\n elements.push(item);\n if( item.localName === 'cura-dropdown-search-option' && item[\"selectable\"] ) selectable.push(item);\n if( item.localName === 'cura-dropdown-search-not-found' ) hasNotFound = true;\n });\n }\n this.dropdownSelectableItems = selectable;\n this.dropdownItems = elements;\n this.status = hasNotFound ? 'error' : 'default';\n }\n\n\n enterZoom() {\n this.scrollBehavior.disableScroll();\n this.setZoomHeight();\n this.zoomState = true;\n }\n\n exitZoom() {\n this.scrollBehavior.enableScroll();\n this.setZoomHeight();\n setTimeout(() => { this.zoomState = false}, 300);\n }\n\n getInputElement = () => this.host.shadowRoot?.querySelector('cura-input-text');\n\n setZoomHeight() {\n const h = window ? `${window.visualViewport?.height || window.innerHeight}px` : '100vh';\n this.styles = { ...this.styles, '--height': h };\n }\n\n getClasses() {\n return {\n \"component-container\": true,\n \"mobile\": this.isMobile,\n \"zoom\": this.zoomState,\n \"dropdown-visible\": this.isOnFocus && (this.dropdownItems.length > 0 && !this.zoomState),\n \"error\": this.status === 'error'\n }\n }\n\n _preventEvent = (ev: Event) => {\n ev.preventDefault();\n ev.stopPropagation();\n }\n\n getHostCSSProperties() {\n return {\n '--max-height': this.maxheight || '400px'\n };\n }\n\n render() {\n return (\n <Host style={ this.getHostCSSProperties() }>\n <div class={ this.getClasses() } style={ this.styles }>\n <div class=\"component-controls\">\n { this.isMobile && this.zoomState ? (\n <cura-button-transparent\n fontColor=\"dark\"\n onClick={ () => this.handleBackClick() }\n iconName=\"arrowLeft\"\n size=\"large\"\n iconOnly\n color=\"primary\"\n id=\"button-back\">\n </cura-button-transparent>\n ) : '' }\n <cura-input-text\n disabled={ this.disabled }\n label={ this.label }\n part=\"cura-input-field\"\n mode={ this.zoomState ? 'transparent' : 'default' }\n required={ this.required }\n iconName={ this.icon || 'search' }\n value={ this.value }\n status={ this.status }\n onValueChange={ (ev) => this.handleInputValueChange(ev) }\n onInput={ (ev) => this._preventEvent(ev) }\n onFocus={ () => this.handleFocus() }\n onClick={ (ev) => this._preventEvent(ev) }\n onBlur={ () => this.handleBlur() }\n onFocusout={ () => this.handleFocusout() }\n onInputClear={ (ev) => this.handleInputClear(ev) }\n placeholder={ this.placeholder }\n size={ this.size }\n onKeyDown={ (ev) => this.handleKeyDown(ev) }\n >\n <slot name=\"helperText\"></slot>\n </cura-input-text>\n </div>\n <div class=\"dropdown-container\" onMouseOver={ () => this.handleDropdownMouseOver() }>\n <slot onSlotchange={ () => this.handleSlotChange() }></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -81,9 +81,13 @@
|
|
|
81
81
|
* Use: @include medium-large() { ... }
|
|
82
82
|
*/
|
|
83
83
|
/**
|
|
84
|
-
* Responsive media for
|
|
85
|
-
* Use: @include
|
|
84
|
+
* Responsive media for medium and up.
|
|
85
|
+
* Use: @include medium-up() { ... }
|
|
86
86
|
*/
|
|
87
|
+
/**
|
|
88
|
+
* Responsive media for large and up.
|
|
89
|
+
* Use: @include large-up() { ... }
|
|
90
|
+
*/
|
|
87
91
|
:host {
|
|
88
92
|
display: block;
|
|
89
93
|
}
|
|
@@ -20,9 +20,13 @@
|
|
|
20
20
|
* Use: @include medium-large() { ... }
|
|
21
21
|
*/
|
|
22
22
|
/**
|
|
23
|
-
* Responsive media for
|
|
24
|
-
* Use: @include
|
|
23
|
+
* Responsive media for medium and up.
|
|
24
|
+
* Use: @include medium-up() { ... }
|
|
25
25
|
*/
|
|
26
|
+
/**
|
|
27
|
+
* Responsive media for large and up.
|
|
28
|
+
* Use: @include large-up() { ... }
|
|
29
|
+
*/
|
|
26
30
|
:host {
|
|
27
31
|
display: block;
|
|
28
32
|
}
|
|
@@ -20,9 +20,13 @@
|
|
|
20
20
|
* Use: @include medium-large() { ... }
|
|
21
21
|
*/
|
|
22
22
|
/**
|
|
23
|
-
* Responsive media for
|
|
24
|
-
* Use: @include
|
|
23
|
+
* Responsive media for medium and up.
|
|
24
|
+
* Use: @include medium-up() { ... }
|
|
25
25
|
*/
|
|
26
|
+
/**
|
|
27
|
+
* Responsive media for large and up.
|
|
28
|
+
* Use: @include large-up() { ... }
|
|
29
|
+
*/
|
|
26
30
|
/**
|
|
27
31
|
* Global Shadow Level Definitions.
|
|
28
32
|
* Required CSS Properties with respective opacities:
|
|
@@ -20,9 +20,13 @@
|
|
|
20
20
|
* Use: @include medium-large() { ... }
|
|
21
21
|
*/
|
|
22
22
|
/**
|
|
23
|
-
* Responsive media for
|
|
24
|
-
* Use: @include
|
|
23
|
+
* Responsive media for medium and up.
|
|
24
|
+
* Use: @include medium-up() { ... }
|
|
25
25
|
*/
|
|
26
|
+
/**
|
|
27
|
+
* Responsive media for large and up.
|
|
28
|
+
* Use: @include large-up() { ... }
|
|
29
|
+
*/
|
|
26
30
|
/**
|
|
27
31
|
* Global Shadow Level Definitions.
|
|
28
32
|
* Required CSS Properties with respective opacities:
|
|
@@ -20,9 +20,13 @@
|
|
|
20
20
|
* Use: @include medium-large() { ... }
|
|
21
21
|
*/
|
|
22
22
|
/**
|
|
23
|
-
* Responsive media for
|
|
24
|
-
* Use: @include
|
|
23
|
+
* Responsive media for medium and up.
|
|
24
|
+
* Use: @include medium-up() { ... }
|
|
25
25
|
*/
|
|
26
|
+
/**
|
|
27
|
+
* Responsive media for large and up.
|
|
28
|
+
* Use: @include large-up() { ... }
|
|
29
|
+
*/
|
|
26
30
|
/**
|
|
27
31
|
* Truncate text in single line
|
|
28
32
|
* Use: @include truncate-single() { ... }
|
|
@@ -65,6 +65,12 @@ export class CuraSelect {
|
|
|
65
65
|
return this.onOptiselected(event);
|
|
66
66
|
this.isOpen = !this.isOpen;
|
|
67
67
|
};
|
|
68
|
+
this.handleClickOutside = (event) => {
|
|
69
|
+
const clickedOutside = !this.host.contains(event.target);
|
|
70
|
+
if (clickedOutside) {
|
|
71
|
+
this.isOpen = false;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
68
74
|
this.label = '';
|
|
69
75
|
this.placeholder = '';
|
|
70
76
|
this.value = '';
|
|
@@ -151,6 +157,7 @@ export class CuraSelect {
|
|
|
151
157
|
*/
|
|
152
158
|
componentDidLoad() {
|
|
153
159
|
this.setupMutationObserver();
|
|
160
|
+
this.addOutsideClickListener();
|
|
154
161
|
}
|
|
155
162
|
/**
|
|
156
163
|
* Lifecycle method called when the component is connected to the DOM.
|
|
@@ -166,6 +173,7 @@ export class CuraSelect {
|
|
|
166
173
|
disconnectedCallback() {
|
|
167
174
|
var _a;
|
|
168
175
|
(_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
176
|
+
this.removeOutsideClickListener();
|
|
169
177
|
}
|
|
170
178
|
initializeOptions() {
|
|
171
179
|
var _a;
|
|
@@ -289,14 +297,20 @@ export class CuraSelect {
|
|
|
289
297
|
const icon = { default: this.iconName, success: 'checkCircle', error: 'alertCircle' }[this.status];
|
|
290
298
|
return h("cura-icon", { class: "feedback-icon", name: icon, iconset: "default", size: this.size === 'large' ? 20 : 16, color: this.getColor('icon'), style: this.styles });
|
|
291
299
|
}
|
|
300
|
+
addOutsideClickListener() {
|
|
301
|
+
document.addEventListener('click', this.handleClickOutside);
|
|
302
|
+
}
|
|
303
|
+
removeOutsideClickListener() {
|
|
304
|
+
document.removeEventListener('click', this.handleClickOutside);
|
|
305
|
+
}
|
|
292
306
|
render() {
|
|
293
|
-
return (h(Host, { key: '
|
|
307
|
+
return (h(Host, { key: '21289e8335a2dab29d78e1f6b689734a68c51f9a', style: this.styles }, h("div", { key: 'c9ff2b904c184f175fe8c354f38f79e9af613e55', class: this.getClasses(), onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), onClick: this.handleClick }, this.label && (h("cura-label", { key: 'ddd53f876c004b0da13cd5d418f33fc36b1d3fb5', class: "label", weight: "bold", size: this.size === 'large' ? 'small' : 'xsmall', color: this.getColor('label') }, this.label, " ", this.required && h("span", { key: 'c884cddfc967c5a9237f745fc14bef84a17403b7', class: "required" }, "* "))), h("div", { key: 'b97ff9564365911abe82914b120276755621e654', class: {
|
|
294
308
|
'cura-input-field': true,
|
|
295
309
|
'open': this.isOpen,
|
|
296
|
-
} }, this.renderIcon(), h("input", { key: '
|
|
310
|
+
} }, this.renderIcon(), h("input", { key: 'dc25c38fea06923ddeee5eff05dbcc380b72a1ba', type: "text", autocomplete: "off", onFocus: () => (this.isFocused = true), onBlur: () => (this.isFocused = false), onKeyDown: this.handleKeyNavigation, "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.textInput, readonly: this.searchBehavior ? null : true }), h("button", { key: 'fef9e0aa81875cc558d7732c45da93043e4f6ef4', class: "up-down-button" }, h("cura-icon", { key: '79200899e32a5ac4b4759e0589c1faddced68103', name: this.isOpen ? 'up' : 'down', class: "up-down-icon", color: this.disabled ? 'neutral-dark' : 'primary-base', size: 16, iconset: "default" }))), h("cura-label", { key: '8d46fa4bc5f61d7fb8e84a0626d4f79e6687ff9f', class: "helper-text", size: "xsmall", color: this.getColor('text'), weight: this.mode === 'transparent' ? 'bold' : 'regular' }, h("slot", { key: '9a42d25acea3e8320e6639545c5a550192224824' })), this.isOpen && (h("div", { key: '657fc9d3fc88f946dfd33fc85b2c1b8f074231ad', class: {
|
|
297
311
|
menu: true,
|
|
298
312
|
open: this.isOpen,
|
|
299
|
-
} }, h("slot", { key: '
|
|
313
|
+
} }, h("slot", { key: '6e18ba370c1eaef8b2cae03405bc1dc716633ec5', name: "option" }))))));
|
|
300
314
|
}
|
|
301
315
|
static get is() { return "cura-select"; }
|
|
302
316
|
static get encapsulation() { return "shadow"; }
|