@jumpgroup/jump-design-system 0.3.9 → 0.3.14
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/chunk.H33C3MRM-2c09acb5.js +547 -0
- package/dist/cjs/chunk.H33C3MRM-2c09acb5.js.map +1 -0
- package/dist/cjs/jump-button_2.cjs.entry.js +3 -525
- package/dist/cjs/jump-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/jump-design-system.cjs.js +1 -1
- package/dist/cjs/jump-filter-checkbox.cjs.entry.js +845 -0
- package/dist/cjs/jump-filter-checkbox.cjs.entry.js.map +1 -0
- package/dist/cjs/jump-filter.cjs.entry.js +5 -4
- package/dist/cjs/jump-filter.cjs.entry.js.map +1 -1
- package/dist/cjs/jump-filtergroup.cjs.entry.js +19 -3
- package/dist/cjs/jump-filtergroup.cjs.entry.js.map +1 -1
- package/dist/cjs/jump-pagination-table.cjs.entry.js +3 -3
- package/dist/cjs/jump-pagination.cjs.entry.js +3 -3
- package/dist/cjs/jump-quantity.cjs.entry.js +4 -4
- package/dist/cjs/jump-quantity.cjs.entry.js.map +1 -1
- package/dist/cjs/jump-tab-item.cjs.entry.js +2 -2
- package/dist/cjs/jump-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/jump-tab.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/jump-filter/jump-filter.css +8 -1
- package/dist/collection/components/jump-filter/jump-filter.js +5 -4
- package/dist/collection/components/jump-filter/jump-filter.js.map +1 -1
- package/dist/collection/components/jump-filter/jump-filter.stories.js +5 -4
- package/dist/collection/components/jump-filter/jump-filter.stories.js.map +1 -1
- package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.css +31 -0
- package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.js +161 -0
- package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.js.map +1 -0
- package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.stories.js +51 -0
- package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.stories.js.map +1 -0
- package/dist/collection/components/jump-filtergroup/jump-filtergroup.js +21 -5
- package/dist/collection/components/jump-filtergroup/jump-filtergroup.js.map +1 -1
- package/dist/collection/components/jump-filtergroup/jump-filtergroup.stories.js +1 -1
- package/dist/collection/components/jump-filtergroup/jump-filtergroup.stories.js.map +1 -1
- package/dist/collection/components/jump-pagination/jump-pagination.js +3 -3
- package/dist/collection/components/jump-pagination-table/jump-pagination-table.js +3 -3
- package/dist/collection/components/jump-quantity/jump-quantity.css +6 -3
- package/dist/collection/components/jump-quantity/jump-quantity.js +3 -3
- package/dist/collection/components/jump-quantity/jump-quantity.js.map +1 -1
- package/dist/collection/components/jump-tab/jump-tab.js +1 -1
- package/dist/collection/components/jump-tab-item/jump-tab-item.js +2 -2
- package/dist/collection/components/jump-tab-panel/jump-tab-panel.js +1 -1
- package/dist/components/chunk.H33C3MRM.js +529 -0
- package/dist/components/chunk.H33C3MRM.js.map +1 -0
- package/dist/components/jump-filter-checkbox.d.ts +11 -0
- package/dist/components/jump-filter-checkbox.js +865 -0
- package/dist/components/jump-filter-checkbox.js.map +1 -0
- package/dist/components/jump-filter.js +5 -4
- package/dist/components/jump-filter.js.map +1 -1
- package/dist/components/jump-filtergroup.js +20 -4
- package/dist/components/jump-filtergroup.js.map +1 -1
- package/dist/components/jump-icon2.js +6 -528
- package/dist/components/jump-icon2.js.map +1 -1
- package/dist/components/jump-pagination-table.js +3 -3
- package/dist/components/jump-pagination.js +3 -3
- package/dist/components/jump-quantity.js +4 -4
- package/dist/components/jump-quantity.js.map +1 -1
- package/dist/components/jump-tab-item.js +2 -2
- package/dist/components/jump-tab-panel.js +1 -1
- package/dist/components/jump-tab.js +1 -1
- package/dist/esm/chunk.H33C3MRM-d1872e67.js +529 -0
- package/dist/esm/chunk.H33C3MRM-d1872e67.js.map +1 -0
- package/dist/esm/jump-button_2.entry.js +6 -528
- package/dist/esm/jump-button_2.entry.js.map +1 -1
- package/dist/esm/jump-design-system.js +1 -1
- package/dist/esm/jump-filter-checkbox.entry.js +841 -0
- package/dist/esm/jump-filter-checkbox.entry.js.map +1 -0
- package/dist/esm/jump-filter.entry.js +5 -4
- package/dist/esm/jump-filter.entry.js.map +1 -1
- package/dist/esm/jump-filtergroup.entry.js +19 -3
- package/dist/esm/jump-filtergroup.entry.js.map +1 -1
- package/dist/esm/jump-pagination-table.entry.js +3 -3
- package/dist/esm/jump-pagination.entry.js +3 -3
- package/dist/esm/jump-quantity.entry.js +4 -4
- package/dist/esm/jump-quantity.entry.js.map +1 -1
- package/dist/esm/jump-tab-item.entry.js +2 -2
- package/dist/esm/jump-tab-panel.entry.js +1 -1
- package/dist/esm/jump-tab.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/jump-design-system/jump-design-system.esm.js +1 -1
- package/dist/jump-design-system/jump-design-system.esm.js.map +1 -1
- package/dist/jump-design-system/{p-95460fa4.entry.js → p-4302b229.entry.js} +2 -2
- package/dist/jump-design-system/p-60849b83.entry.js +2 -0
- package/dist/jump-design-system/p-60849b83.entry.js.map +1 -0
- package/dist/jump-design-system/p-839e054d.entry.js +2 -0
- package/dist/jump-design-system/p-839e054d.entry.js.map +1 -0
- package/dist/jump-design-system/{p-d2ee7b9b.entry.js → p-9d9b0076.entry.js} +2 -2
- package/dist/jump-design-system/p-a00d20d8.entry.js +264 -0
- package/dist/jump-design-system/p-a00d20d8.entry.js.map +1 -0
- package/dist/jump-design-system/p-a41ca036.entry.js +2 -0
- package/dist/jump-design-system/p-a41ca036.entry.js.map +1 -0
- package/dist/jump-design-system/p-a4b9515b.js +66 -0
- package/dist/jump-design-system/p-a4b9515b.js.map +1 -0
- package/dist/jump-design-system/p-aee5a8c3.entry.js +2 -0
- package/dist/jump-design-system/{p-37114ce3.entry.js → p-c8733544.entry.js} +2 -2
- package/dist/jump-design-system/{p-8efeaa79.entry.js → p-ed897778.entry.js} +2 -2
- package/dist/jump-design-system/p-fde99383.entry.js +2 -0
- package/dist/jump-design-system/p-fde99383.entry.js.map +1 -0
- package/dist/jump-design-system-elements.json +29 -4
- package/dist/types/components/jump-filter-checkbox/jump-filter-checkbox.d.ts +15 -0
- package/dist/types/components/jump-filter-checkbox/jump-filter-checkbox.stories.d.ts +30 -0
- package/dist/types/components/jump-filtergroup/jump-filtergroup.d.ts +2 -1
- package/dist/types/components/jump-filtergroup/jump-filtergroup.stories.d.ts +1 -1
- package/dist/types/components.d.ts +40 -2
- package/package.json +1 -1
- package/dist/jump-design-system/p-529a09f6.entry.js +0 -2
- package/dist/jump-design-system/p-529a09f6.entry.js.map +0 -1
- package/dist/jump-design-system/p-5da7839d.entry.js +0 -2
- package/dist/jump-design-system/p-8628896f.entry.js +0 -2
- package/dist/jump-design-system/p-8628896f.entry.js.map +0 -1
- package/dist/jump-design-system/p-c2bc6395.entry.js +0 -66
- package/dist/jump-design-system/p-c2bc6395.entry.js.map +0 -1
- package/dist/jump-design-system/p-d1e411fd.entry.js +0 -2
- package/dist/jump-design-system/p-d1e411fd.entry.js.map +0 -1
- /package/dist/jump-design-system/{p-95460fa4.entry.js.map → p-4302b229.entry.js.map} +0 -0
- /package/dist/jump-design-system/{p-d2ee7b9b.entry.js.map → p-9d9b0076.entry.js.map} +0 -0
- /package/dist/jump-design-system/{p-5da7839d.entry.js.map → p-aee5a8c3.entry.js.map} +0 -0
- /package/dist/jump-design-system/{p-37114ce3.entry.js.map → p-c8733544.entry.js.map} +0 -0
- /package/dist/jump-design-system/{p-8efeaa79.entry.js.map → p-ed897778.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jump-filter.js","sourceRoot":"","sources":["../../../src/components/jump-filter/jump-filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, State, Listen, Method } from '@stencil/core';\n\n@Component({\n tag: 'jump-filter',\n styleUrl: 'jump-filter.scss',\n shadow: true,\n})\nexport class JumpFilter {\n\n @Prop() direction: 'horizontal' | 'vertical' = 'vertical';\n @Prop() filterHeading: string = 'Filtra per';\n @Prop() filterButtonLabel: string = 'Filtri';\n @Prop() filterButtonIcon: string = 'sliders';\n @Prop() mobileThreshold: number = 768;\n @Prop() filters: any;\n\n @State() activeFilters: number = 0;\n @State() showMobileFilters: boolean = false;\n @State() isMobile: boolean = false;\n\n mobileToggle: HTMLElement | null;\n filtersDrawer: HTMLElement;\n\n @Listen('jump-filterchange')\n filterChangeHandler(event: CustomEvent) {\n //set this.filter as this.filters[event.detail.name] = event.detail.value; even if not present\n this.filters = {...this.filters, [event.detail.name]: event.detail.values};\n console.log('Received the custom filterChange event: ', this.filters);\n\n\n\n //TODO: increment this.activeFilters\n }\n\n @Listen('resize', { target: 'window' })\n handleResize() {\n this.isMobile = window.innerWidth < this.mobileThreshold;\n }\n\n /**\n * Get the active filters from the component\n */\n @Method()\n async getFilters() {\n return this.filters;\n }\n\n componentDidLoad(){\n this.toggleMobileFilters();\n }\n\n toggleMobileFilters() {\n if(this.mobileToggle){\n this.mobileToggle.addEventListener('click', () => {\n if(!this.isMobile) return;\n this.showMobileFilters = !this.showMobileFilters;\n });\n }\n }\n\n render() {\n return (\n <Host mobileFilters={this.showMobileFilters}>\n {this.isMobile && <jump-button\n ref={(el) => {this.mobileToggle = el}}\n buttonId={this.filterButtonIcon} variant={'primary'} outline={true}>\n <slot name=\"prefix\">\n {this.filterButtonIcon &&\n <jump-icon library=\"fa\" category=\"regular\" name={this.filterButtonIcon} size=\"small\"></jump-icon>}\n {this.filterButtonLabel}\n </slot>\n <slot name=\"suffix\">\n {this.activeFilters > 0 ? `(${this.activeFilters})` : '0'}\n </slot>\n </jump-button>}\n\n {<div\n ref={(el) => {this.filtersDrawer = el}}\n class=\"filtersDrawer\" data-variant={this.direction}>\n {!this.isMobile &&\n <div class={'filtersDrawer__header'}>\n <jump-icon class=\"small\" name={this.filterButtonIcon}></jump-icon>\n <h3>{this.filterHeading}</h3>\n </div>}\n <slot></slot>\n </div>}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -62,11 +62,12 @@ const TemplateWithSelectFilter = (args) => {
|
|
|
62
62
|
export const WithSelectFilter = TemplateWithSelectFilter.bind({});
|
|
63
63
|
const TemplateWithCheckboxFilter = (args) => {
|
|
64
64
|
const attributes = generateAttributesFromArgs(args);
|
|
65
|
-
return formatHtml(
|
|
65
|
+
return formatHtml(`
|
|
66
|
+
<jump-filter ${attributes} name='sort' title='Ordina per'>
|
|
66
67
|
<jump-filtergroup class='filterGroupCheckbox' name='animal' title='Animale' other-label='Mostra di più' max-elements='3'>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
<jump-filter-checkbox value="cane" label="Cane" count="12"></jump-filter-checkbox>
|
|
69
|
+
<jump-filter-checkbox value="gatto" label="Gatto"></jump-filter-checkbox>
|
|
70
|
+
<jump-filter-checkbox value="pesce" label="Pesce"></jump-filter-checkbox>
|
|
70
71
|
</jump-filtergroup>
|
|
71
72
|
</jump-filter>`);
|
|
72
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jump-filter.stories.js","sourceRoot":"","sources":["../../../src/components/jump-filter/jump-filter.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE1E,eAAe;IACb,KAAK,EAAE,+BAA+B;IACtC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,gBAAgB;QAChB,SAAS,EAAE;YACT,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;aACpC;SACF;QACD,aAAa,EAAE;YACb,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,gCAAgC;aAC9C;SACF;QACD,iBAAiB,EAAE;YACjB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;aACb;SACF;QACD,gBAAgB,EAAE;YAChB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;aACb;SACF;QACD,eAAe,EAAE;YACf,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;aACf;YACD,YAAY,EAAE,GAAG;SAClB;KACF;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE;IACxB,MAAM,UAAU,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,UAAU,CAAC,gBAAgB,UAAU;;;;;;;;;eAS/B,CAAC,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEzC,MAAM,wBAAwB,GAAG,CAAC,IAAI,EAAE,EAAE;IACxC,MAAM,UAAU,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,UAAU,CAAC,qBAAqB,UAAU;;;;;;;oBAO/B,CAAC,CAAC;AACtB,CAAC,CAAA;AACD,MAAM,CAAC,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAElE,MAAM,0BAA0B,GAAG,CAAC,IAAI,EAAE,EAAE;IAC1C,MAAM,UAAU,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"jump-filter.stories.js","sourceRoot":"","sources":["../../../src/components/jump-filter/jump-filter.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE1E,eAAe;IACb,KAAK,EAAE,+BAA+B;IACtC,I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AAC,CAAC;AACnB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEtE,uBAAuB;AACvB,MAAM,wBAAwB,GAAG,CAAC,IAAI,EAAE,EAAE;IACxC,MAAM,UAAU,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,UAAU,CAAC,gBAAgB,UAAU;;;;;;;;;;;;;;;;;;;;;iBAqB7B,CAAC,CAAC;AACnB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAGlE,MAAM,uBAAuB,GAAG,CAAC,IAAI,EAAE,EAAE;IACvC,MAAM,UAAU,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,UAAU,CAAC,gBAAgB,UAAU;;;;;;;;;;;;;;;;iBAgB7B,CAAC,CAAC;AACnB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import { generateAttributesFromArgs, formatHtml} from '../../utils/utils';\n\nexport default {\n title: 'Components/Filters/JumpFilter',\n tags: ['autodocs'],\n argTypes: {\n //list all props\n direction: {\n control: {\n type: 'select',\n options: ['horizontal', 'vertical']\n }\n },\n filterHeading: {\n control: {\n type: 'text',\n description: 'Intestazione drawer dei filtri'\n }\n },\n filterButtonLabel: {\n control: {\n type: 'text'\n }\n },\n filterButtonIcon: {\n control: {\n type: 'text'\n }\n },\n mobileThreshold: {\n control: {\n type: 'number'\n },\n defaultValue: 768\n },\n }\n};\n\nconst Template = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-filter ${attributes}>\n <!-- TODO: Replace with jump components -->\n <jump-filtergroup class='filterGroup' name=\"tax-name\" title=\"Titolo del filtro\" other-label=\"Mostra di più\" max-elements=3>\n <select label=\"Ordina per\" variant=\"primary\" size=\"small\">\n <option value=\"0\">Ordina per</option>\n <option value=\"latest\">Più recenti</option>\n <option value=\"oldest\">Più vecchi</option>\n </select>\n </jump-filtergroup>\n</jump-filter>`);\n};\n\nexport const Default = Template.bind({});\n\nconst TemplateWithSelectFilter = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-filtergroup ${attributes} name='sort' title='Ordina per'>\n <select class='filterGroupSelect' label=\"Ordina per\" variant=\"primary\" size=\"small\">\n <option value=\"0\">Ordina per</option>\n <option value=\"latest\">Più recenti</option>\n <option value=\"oldest\">Più vecchi</option>\n </select>\n </jump-filtergroup>\n</jump-filtergroup>`);\n}\nexport const WithSelectFilter = TemplateWithSelectFilter.bind({});\n\nconst TemplateWithCheckboxFilter = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`\n <jump-filter ${attributes} name='sort' title='Ordina per'>\n <jump-filtergroup class='filterGroupCheckbox' name='animal' title='Animale' other-label='Mostra di più' max-elements='3'>\n <jump-filter-checkbox value=\"cane\" label=\"Cane\" count=\"12\"></jump-filter-checkbox>\n <jump-filter-checkbox value=\"gatto\" label=\"Gatto\"></jump-filter-checkbox>\n <jump-filter-checkbox value=\"pesce\" label=\"Pesce\"></jump-filter-checkbox>\n </jump-filtergroup>\n </jump-filter>`);\n}\n\nexport const WithCheckboxFilter = TemplateWithCheckboxFilter.bind({});\n\n//mixed kind of filters\nconst TemplateWithMixedFilters = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-filter ${attributes} name='sort' title='Ordina per'>\n <!-- select group -->\n <jump-filtergroup class='filterGroupSelect' name=\"tax-select-sample\" title=\"Ordinamento\" other-label=\"Mostra di più\" max-elements=3>\n <select class='filterGroupSelect' label=\"Ordina per\" variant=\"primary\" size=\"small\">\n <option value=\"0\">Ordina per</option>\n <option value=\"latest\">Più recenti</option>\n <option value=\"oldest\">Più vecchi</option>\n </select>\n </jump-filtergroup>\n\n <jump-filtergroup class='filterGroupCheckbox' name=\"tax-animal-sample-checkbox\" title=\"Animali\" other-label=\"Mostra di più\" max-elements=3>\n <label><input type='checkbox' value='cane'>Cane</label>\n <label><input type='checkbox' value='gatto'>Gatto</label>\n <label><input type='checkbox' value='pesce'>Pesce</label>\n </jump-filtergroup>\n\n <!-- radio group -->\n <jump-filtergroup class='filterGroupRadio' name=\"tax-animal-sample-radio\" title=\"Animali 2\" other-label=\"Mostra di più\" max-elements=3>\n <label><input type='radio' value='snakes'>Serpenti</label>\n <label><input type='radio' value='spiders'>Ragni</label>\n </jump-filtergroup>\n </jump-filter>`);\n}\n\nexport const WithMixedFilters = TemplateWithMixedFilters.bind({});\n\n\nconst TemplateWithMoreFilters = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-filter ${attributes} name='sort' title='Ordina per'>\n <jump-filtergroup class='filterGroupCheckbox' name=\"tax-animal-sample-checkbox\" title=\"Animali\" other-label=\"Mostra di più\" max-elements=8>\n <label><input type='checkbox' value='cane'>Cane</label>\n <label><input type='checkbox' value='gatto'>Gatto</label>\n <label><input type='checkbox' value='pesce'>Pesce</label>\n <label><input type='checkbox' value='cavallo'>Cavallo</label>\n <label><input type='checkbox' value='topo'>Topo</label>\n <label><input type='checkbox' value='coniglio'>Coniglio</label>\n <label><input type='checkbox' value='pappagallo'>Pappagallo</label>\n <label><input type='checkbox' value='tartaruga'>Tartaruga</label>\n <label><input type='checkbox' value='criceto'>Criceto</label>\n <label><input type='checkbox' value='canarino'>Canarino</label>\n <label><input type='checkbox' value='pesciolino'>Pesciolino</label>\n <label><input type='checkbox' value='pappagallino'>Pappagallino</label>\n <label><input type='checkbox' value='tartarughina'>Tartarughina</label>\n </jump-filtergroup>\n </jump-filter>`);\n}\n\nexport const WithMoreFilters = TemplateWithMoreFilters.bind({});\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
:host .count {
|
|
6
|
+
color: var(--neutral-grey-secondary, #707070);
|
|
7
|
+
}
|
|
8
|
+
:host sl-checkbox {
|
|
9
|
+
display: flex;
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
:host sl-checkbox::part(control) {
|
|
13
|
+
height: 1rem;
|
|
14
|
+
width: 1rem;
|
|
15
|
+
border: 1px solid var(--neutral-grey-secondary, #707070);
|
|
16
|
+
border-radius: 3px;
|
|
17
|
+
}
|
|
18
|
+
:host sl-checkbox::part(control--checked) {
|
|
19
|
+
background-color: var(--status-interaction-standard, #2C6ECB);
|
|
20
|
+
border-color: var(--status-interaction-standard, #2C6ECB);
|
|
21
|
+
color: var(--neutral-ultralight, #fff);
|
|
22
|
+
}
|
|
23
|
+
:host sl-checkbox::part(label) {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: row;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
align-items: flex-start;
|
|
28
|
+
flex-grow: 1;
|
|
29
|
+
color: var(--neutral-grey-primary, #1d1d1d);
|
|
30
|
+
font-family: var(--ff-primary), serif;
|
|
31
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import "@shoelace-style/shoelace/dist/components/checkbox/checkbox.js";
|
|
3
|
+
export class JumpFilterCheckbox {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.value = undefined;
|
|
6
|
+
this.label = undefined;
|
|
7
|
+
this.checked = false;
|
|
8
|
+
this.count = null;
|
|
9
|
+
}
|
|
10
|
+
componentDidLoad() {
|
|
11
|
+
this.listenSLChange();
|
|
12
|
+
}
|
|
13
|
+
listenSLChange() {
|
|
14
|
+
if (this.host) {
|
|
15
|
+
this.host.addEventListener('sl-change', () => {
|
|
16
|
+
//invert the checked value
|
|
17
|
+
this.checked = !this.checked;
|
|
18
|
+
this.toggleCheckbox.emit({
|
|
19
|
+
//@ts-ignore
|
|
20
|
+
value: this.el.value,
|
|
21
|
+
//@ts-ignore
|
|
22
|
+
checked: this.checked,
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async isChecked() {
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
return this.el.checked;
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return (h(Host, { key: '8c7ea463a6e26c6f77962cd0295dcb41411fa074', ref: (host) => this.host = host }, this.value && this.label &&
|
|
33
|
+
h("sl-checkbox", { key: '7467e1c364d868c7d58a58937411daf4f8c4e397', value: this.value, ref: (el) => this.el = el, checked: this.checked }, this.label), this.count && h("span", { key: 'e3add7e4ad2024096d8484b93cb276ac714d57d8', class: "count" }, "(", this.count, ")")));
|
|
34
|
+
}
|
|
35
|
+
static get is() { return "jump-filter-checkbox"; }
|
|
36
|
+
static get encapsulation() { return "shadow"; }
|
|
37
|
+
static get originalStyleUrls() {
|
|
38
|
+
return {
|
|
39
|
+
"$": ["jump-filter-checkbox.scss"]
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
static get styleUrls() {
|
|
43
|
+
return {
|
|
44
|
+
"$": ["jump-filter-checkbox.css"]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
static get properties() {
|
|
48
|
+
return {
|
|
49
|
+
"value": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"mutable": false,
|
|
52
|
+
"complexType": {
|
|
53
|
+
"original": "string",
|
|
54
|
+
"resolved": "string",
|
|
55
|
+
"references": {}
|
|
56
|
+
},
|
|
57
|
+
"required": false,
|
|
58
|
+
"optional": false,
|
|
59
|
+
"docs": {
|
|
60
|
+
"tags": [],
|
|
61
|
+
"text": ""
|
|
62
|
+
},
|
|
63
|
+
"attribute": "value",
|
|
64
|
+
"reflect": false
|
|
65
|
+
},
|
|
66
|
+
"label": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"mutable": false,
|
|
69
|
+
"complexType": {
|
|
70
|
+
"original": "string",
|
|
71
|
+
"resolved": "string",
|
|
72
|
+
"references": {}
|
|
73
|
+
},
|
|
74
|
+
"required": false,
|
|
75
|
+
"optional": false,
|
|
76
|
+
"docs": {
|
|
77
|
+
"tags": [],
|
|
78
|
+
"text": ""
|
|
79
|
+
},
|
|
80
|
+
"attribute": "label",
|
|
81
|
+
"reflect": false
|
|
82
|
+
},
|
|
83
|
+
"checked": {
|
|
84
|
+
"type": "boolean",
|
|
85
|
+
"mutable": false,
|
|
86
|
+
"complexType": {
|
|
87
|
+
"original": "boolean",
|
|
88
|
+
"resolved": "boolean",
|
|
89
|
+
"references": {}
|
|
90
|
+
},
|
|
91
|
+
"required": false,
|
|
92
|
+
"optional": false,
|
|
93
|
+
"docs": {
|
|
94
|
+
"tags": [],
|
|
95
|
+
"text": ""
|
|
96
|
+
},
|
|
97
|
+
"attribute": "checked",
|
|
98
|
+
"reflect": true,
|
|
99
|
+
"defaultValue": "false"
|
|
100
|
+
},
|
|
101
|
+
"count": {
|
|
102
|
+
"type": "any",
|
|
103
|
+
"mutable": false,
|
|
104
|
+
"complexType": {
|
|
105
|
+
"original": "number | string",
|
|
106
|
+
"resolved": "number | string",
|
|
107
|
+
"references": {}
|
|
108
|
+
},
|
|
109
|
+
"required": false,
|
|
110
|
+
"optional": false,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": ""
|
|
114
|
+
},
|
|
115
|
+
"attribute": "count",
|
|
116
|
+
"reflect": false,
|
|
117
|
+
"defaultValue": "null"
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
static get events() {
|
|
122
|
+
return [{
|
|
123
|
+
"method": "toggleCheckbox",
|
|
124
|
+
"name": "jump-checkbox-change",
|
|
125
|
+
"bubbles": true,
|
|
126
|
+
"cancelable": true,
|
|
127
|
+
"composed": true,
|
|
128
|
+
"docs": {
|
|
129
|
+
"tags": [],
|
|
130
|
+
"text": ""
|
|
131
|
+
},
|
|
132
|
+
"complexType": {
|
|
133
|
+
"original": "any",
|
|
134
|
+
"resolved": "any",
|
|
135
|
+
"references": {}
|
|
136
|
+
}
|
|
137
|
+
}];
|
|
138
|
+
}
|
|
139
|
+
static get methods() {
|
|
140
|
+
return {
|
|
141
|
+
"isChecked": {
|
|
142
|
+
"complexType": {
|
|
143
|
+
"signature": "() => Promise<any>",
|
|
144
|
+
"parameters": [],
|
|
145
|
+
"references": {
|
|
146
|
+
"Promise": {
|
|
147
|
+
"location": "global",
|
|
148
|
+
"id": "global::Promise"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"return": "Promise<any>"
|
|
152
|
+
},
|
|
153
|
+
"docs": {
|
|
154
|
+
"text": "",
|
|
155
|
+
"tags": []
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=jump-filter-checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jump-filter-checkbox.js","sourceRoot":"","sources":["../../../src/components/jump-filter-checkbox/jump-filter-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,+DAA+D,CAAC;AAOvE,MAAM,OAAO,kBAAkB;;;;uBAIe,KAAK;qBAChB,IAAI;;IAKrC,gBAAgB;QACd,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED,cAAc;QACZ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,GAAG,EAAE;gBAC3C,0BAA0B;gBAC1B,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC7B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;oBACvB,YAAY;oBACZ,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK;oBACpB,YAAY;oBACZ,OAAO,EAAE,IAAI,CAAC,OAAO;iBACtB,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAKD,KAAK,CAAC,SAAS;QACb,aAAa;QACb,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;IACzB,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,GAAG,EAAE,CAAC,IAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI;YAC/C,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK;gBACvB,oEAAa,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,EAAe,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EACpE,OAAO,EAAE,IAAI,CAAC,OAAO,IACpB,IAAI,CAAC,KAAK,CACC;YACf,IAAI,CAAC,KAAK,IAAI,6DAAM,KAAK,EAAC,OAAO;;gBAAG,IAAI,CAAC,KAAK;oBAAS,CACnD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter, Method } from '@stencil/core';\nimport '@shoelace-style/shoelace/dist/components/checkbox/checkbox.js';\n\n@Component({\n tag: 'jump-filter-checkbox',\n styleUrl: 'jump-filter-checkbox.scss',\n shadow: true,\n})\nexport class JumpFilterCheckbox {\n\n @Prop() value: string;\n @Prop() label: string;\n @Prop({ reflect: true }) checked: boolean = false;\n @Prop() count: number | string = null;\n\n host: HTMLElement;\n el: HTMLElement;\n\n componentDidLoad() {\n this.listenSLChange();\n }\n\n listenSLChange() {\n if (this.host) {\n this.host.addEventListener('sl-change', () => {\n //invert the checked value\n this.checked = !this.checked;\n this.toggleCheckbox.emit({\n //@ts-ignore\n value: this.el.value,\n //@ts-ignore\n checked: this.checked,\n });\n });\n }\n }\n\n @Event({ eventName: 'jump-checkbox-change' }) toggleCheckbox: EventEmitter;\n\n @Method()\n async isChecked() {\n // @ts-ignore\n return this.el.checked;\n }\n\n render() {\n return (\n <Host ref={(host: HTMLElement) => this.host = host}>\n {this.value && this.label &&\n <sl-checkbox value={this.value} ref={(el: HTMLElement) => this.el = el}\n checked={this.checked}>\n {this.label}\n </sl-checkbox>}\n {this.count && <span class=\"count\">({this.count})</span>}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { generateAttributesFromArgs, formatHtml } from "../../utils/utils";
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Components/Filters/JumpFilterCheckbox',
|
|
4
|
+
tags: ['autodocs'],
|
|
5
|
+
argTypes: {
|
|
6
|
+
value: {
|
|
7
|
+
name: 'value',
|
|
8
|
+
control: 'text',
|
|
9
|
+
description: 'Il valore del checkbox',
|
|
10
|
+
label: 'ciao',
|
|
11
|
+
},
|
|
12
|
+
label: {
|
|
13
|
+
name: 'label',
|
|
14
|
+
control: 'text',
|
|
15
|
+
description: 'Il testo del label',
|
|
16
|
+
},
|
|
17
|
+
checked: {
|
|
18
|
+
name: 'checked',
|
|
19
|
+
control: 'boolean',
|
|
20
|
+
description: 'Il valore iniziale del checkbox',
|
|
21
|
+
},
|
|
22
|
+
count: {
|
|
23
|
+
name: 'count',
|
|
24
|
+
control: 'number',
|
|
25
|
+
description: 'Il numero da visualizzare',
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const Template = (args) => {
|
|
30
|
+
const attributes = generateAttributesFromArgs(args);
|
|
31
|
+
return formatHtml(`<jump-filter-checkbox ${attributes}>
|
|
32
|
+
</jump-filter-checkbox>`);
|
|
33
|
+
};
|
|
34
|
+
export const Default = Template.bind({});
|
|
35
|
+
const TemplateSampleMultiple = () => {
|
|
36
|
+
return formatHtml(`
|
|
37
|
+
<script>
|
|
38
|
+
document.addEventListener('jump-checkbox-change', (event) => {
|
|
39
|
+
alert('Received the custom jump-checkbox-change event: ' + JSON.stringify(event.detail));
|
|
40
|
+
console.log('Received the custom jump-checkbox-change event: ', event.detail);
|
|
41
|
+
});
|
|
42
|
+
</script>
|
|
43
|
+
<div style="max-width: 200px;">
|
|
44
|
+
<jump-filter-checkbox value="1" label="Dieci" count="10"></jump-filter-checkbox>
|
|
45
|
+
<jump-filter-checkbox value="2" label="Venti" count="20" checked></jump-filter-checkbox>
|
|
46
|
+
<jump-filter-checkbox value="3" label="Trenta" count="30"></jump-filter-checkbox>
|
|
47
|
+
</div>
|
|
48
|
+
`);
|
|
49
|
+
};
|
|
50
|
+
export const TemplateSampleMulti = TemplateSampleMultiple.bind({});
|
|
51
|
+
//# sourceMappingURL=jump-filter-checkbox.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jump-filter-checkbox.stories.js","sourceRoot":"","sources":["../../../src/components/jump-filter-checkbox/jump-filter-checkbox.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE1E,eAAe;IACb,KAAK,EAAE,uCAAuC;IAC9C,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,wBAAwB;YACrC,KAAK,EAAE,MAAM;SACd;QACD,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,oBAAoB;SAClC;QACD,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,iCAAiC;SAC/C;QACD,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,QAAQ;YACjB,WAAW,EAAE,2BAA2B;SACzC;KACF;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE;IACxB,MAAM,UAAU,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,UAAU,CAAC,yBAAyB,UAAU;wBAC/B,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAGzC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IAClC,OAAO,UAAU,CAAC;;;;;;;;;;;;CAYnB,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import { generateAttributesFromArgs, formatHtml} from '../../utils/utils';\n\nexport default {\n title: 'Components/Filters/JumpFilterCheckbox',\n tags: ['autodocs'],\n argTypes: {\n value: {\n name: 'value',\n control: 'text',\n description: 'Il valore del checkbox',\n label: 'ciao',\n },\n label: {\n name: 'label',\n control: 'text',\n description: 'Il testo del label',\n },\n checked: {\n name: 'checked',\n control: 'boolean',\n description: 'Il valore iniziale del checkbox',\n },\n count: {\n name: 'count',\n control: 'number',\n description: 'Il numero da visualizzare',\n },\n }\n};\n\nconst Template = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-filter-checkbox ${attributes}>\n</jump-filter-checkbox>`);\n};\n\nexport const Default = Template.bind({});\n\n\nconst TemplateSampleMultiple = () => {\n return formatHtml(`\n <script>\n document.addEventListener('jump-checkbox-change', (event) => {\n alert('Received the custom jump-checkbox-change event: ' + JSON.stringify(event.detail));\n console.log('Received the custom jump-checkbox-change event: ', event.detail);\n });\n </script>\n <div style=\"max-width: 200px;\">\n <jump-filter-checkbox value=\"1\" label=\"Dieci\" count=\"10\"></jump-filter-checkbox>\n <jump-filter-checkbox value=\"2\" label=\"Venti\" count=\"20\" checked></jump-filter-checkbox>\n <jump-filter-checkbox value=\"3\" label=\"Trenta\" count=\"30\"></jump-filter-checkbox>\n </div>\n`);\n};\n\nexport const TemplateSampleMulti = TemplateSampleMultiple.bind({});\n"]}
|
|
@@ -2,7 +2,7 @@ import { Host, h } from "@stencil/core";
|
|
|
2
2
|
export class JumpFiltergroup {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.name = 'tax-name';
|
|
5
|
-
this.
|
|
5
|
+
this.heading = 'Titolo del filtro';
|
|
6
6
|
this.otherLabel = 'Mostra altro';
|
|
7
7
|
this.lessLabel = 'Mostra meno';
|
|
8
8
|
this.maxElements = 8;
|
|
@@ -69,9 +69,25 @@ export class JumpFiltergroup {
|
|
|
69
69
|
values: this.values,
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
+
handleCheckboxChange(event) {
|
|
73
|
+
if (event.detail.checked && !this.values.includes(event.detail.value)) {
|
|
74
|
+
this.values.push(event.detail.value);
|
|
75
|
+
}
|
|
76
|
+
else if (!event.detail.checked && this.values.includes(event.detail.value)) {
|
|
77
|
+
const index = this.values.indexOf(event.detail.value);
|
|
78
|
+
if (index !== -1) {
|
|
79
|
+
this.values.splice(index, 1);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
this.change.emit({
|
|
83
|
+
name: this.name,
|
|
84
|
+
values: this.values,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
72
87
|
componentDidLoad() {
|
|
73
88
|
this.slotItems = this.slotItemsWrapper.assignedElements();
|
|
74
89
|
this.slotItemsWrapper.addEventListener('change', this.handleChange.bind(this));
|
|
90
|
+
this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));
|
|
75
91
|
let index = 0;
|
|
76
92
|
this.slotItems.forEach((item) => {
|
|
77
93
|
if (index > this.maxElements) {
|
|
@@ -98,8 +114,8 @@ export class JumpFiltergroup {
|
|
|
98
114
|
});
|
|
99
115
|
}
|
|
100
116
|
render() {
|
|
101
|
-
return (h(Host, { key: '
|
|
102
|
-
h("jump-button", { key: '
|
|
117
|
+
return (h(Host, { key: 'dea99beebc67c24f7d4dd7e72e8c87a2504d8beb' }, this.heading && h("h5", { key: '62e6239ba68ed6a8b3bcbd4a09fb504e0d2546bc' }, this.heading), h("div", { key: '4556c42ac238fe081d09a434d39973a84eb5de7d', class: "filterGroup" }, h("slot", { key: 'e62ab17b893a61bd7db190a0110c7b54827b88c2', ref: (el) => (this.slotItemsWrapper = el) })), this.inputs.length > this.maxElements &&
|
|
118
|
+
h("jump-button", { key: '452b3a669ac521aa3f421bd2d59915fd61af2534', variant: "primary", size: "small", text: true, name: this.showMore ? this.otherLabel : this.lessLabel, "aria-label": this.showMore ? this.otherLabel : this.lessLabel, onClick: () => this.handleShowMore() }, this.showMore ? this.otherLabel : this.lessLabel, h("jump-icon", { key: '55c462c090eb7f2531365cc4618b68ec626af432', slot: "suffix", name: this.showMore ? 'chevron-down' : 'chevron-down' }))));
|
|
103
119
|
}
|
|
104
120
|
static get is() { return "jump-filtergroup"; }
|
|
105
121
|
static get encapsulation() { return "shadow"; }
|
|
@@ -133,7 +149,7 @@ export class JumpFiltergroup {
|
|
|
133
149
|
"reflect": false,
|
|
134
150
|
"defaultValue": "'tax-name'"
|
|
135
151
|
},
|
|
136
|
-
"
|
|
152
|
+
"heading": {
|
|
137
153
|
"type": "string",
|
|
138
154
|
"mutable": false,
|
|
139
155
|
"complexType": {
|
|
@@ -147,7 +163,7 @@ export class JumpFiltergroup {
|
|
|
147
163
|
"tags": [],
|
|
148
164
|
"text": ""
|
|
149
165
|
},
|
|
150
|
-
"attribute": "
|
|
166
|
+
"attribute": "heading",
|
|
151
167
|
"reflect": false,
|
|
152
168
|
"defaultValue": "'Titolo del filtro'"
|
|
153
169
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jump-filtergroup.js","sourceRoot":"","sources":["../../../src/components/jump-filtergroup/jump-filtergroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAO/E,MAAM,OAAO,eAAe;;oBACH,UAAU;
|
|
1
|
+
{"version":3,"file":"jump-filtergroup.js","sourceRoot":"","sources":["../../../src/components/jump-filtergroup/jump-filtergroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAO/E,MAAM,OAAO,eAAe;;oBACH,UAAU;uBACP,mBAAmB;0BAChB,cAAc;yBACf,aAAa;2BACX,CAAC;uBAEY,SAAS;sBAExB,EAAE;qBACL,EAAE;;sBAEJ,EAAE;wBACI,IAAI;;IAOjC,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAC5B,CAAC;IAGD,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAC/D,IAAG,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;gBAC5B,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YACnE,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,cAAc;QACZ,IAAI,CAAC,Q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AAS,CACvE;YACL,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW;gBACpC,oEAAa,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,QAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,gBAC9E,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAC5D,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE;oBAC9C,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS;oBACjD,kEAAW,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,GAAc,CAChF,CAEX,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Event, Method } from '@stencil/core';\n\n@Component({\n tag: 'jump-filtergroup',\n styleUrl: 'jump-filtergroup.scss',\n shadow: true,\n})\nexport class JumpFiltergroup {\n @Prop() name: string = 'tax-name';\n @Prop() heading: string = 'Titolo del filtro';\n @Prop() otherLabel: string = 'Mostra altro';\n @Prop() lessLabel: string = 'Mostra meno';\n @Prop() maxElements: number = 8;\n //TODO: Add Accordion variant within jump-acccordion component\n @Prop() variant: 'accordion' | 'default' = 'default';\n\n @State() values: string[] = [];\n @State() value: string = '';\n @State() slotItems: any;\n @State() inputs: any = [];\n @State() showMore: boolean = true;\n\n @Event({ eventName: 'jump-filterchange' }) change;\n\n slotItemsWrapper: HTMLSlotElement;\n\n @Method('getValues')\n async getValues() {\n return this.values;\n }\n\n @Method('getActiveAmount')\n async getActiveAmount() {\n return this.values.length;\n }\n\n @Method('getInputs')\n async getInputs() {\n return this.inputs;\n }\n\n @Method('getName')\n async getName() {\n return this.name;\n }\n\n toggleHiddenItems() {\n this.slotItemsWrapper.assignedElements().forEach((item, index) => {\n if(index > this.maxElements) {\n item.setAttribute('data-hide', this.showMore ? 'true' : 'false');\n }\n });\n }\n\n handleShowMore() {\n this.showMore = !this.showMore;\n this.toggleHiddenItems();\n }\n\n handleChange(event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const newValue = target.value;\n\n if (target.tagName === 'INPUT') {\n if (target.type === 'checkbox') {\n // @ts-ignore\n if (target.checked) {\n this.values.push(newValue);\n } else {\n const index = this.values.indexOf(newValue);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n } else if (target.type === 'radio') {\n // Se è un input radio selezionato, imposta il valore e aggiorna this.values\n this.value = newValue;\n this.values = [newValue]; // Assicurati che this.values contenga solo il valore selezionato\n }\n } else if (target.tagName === 'SELECT') {\n // Se è un select, aggiorna semplicemente il valore\n this.value = newValue;\n this.values = [newValue];\n }\n\n // Emit event con i valori aggiornati\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n handleCheckboxChange(event: CustomEvent) {\n if (event.detail.checked && !this.values.includes(event.detail.value)) {\n this.values.push(event.detail.value);\n } else if (!event.detail.checked && this.values.includes(event.detail.value)) {\n const index = this.values.indexOf(event.detail.value);\n if (index !== -1) {\n this.values.splice(index, 1);\n }\n }\n this.change.emit({\n name: this.name,\n values: this.values,\n });\n }\n\n componentDidLoad() {\n this.slotItems = this.slotItemsWrapper.assignedElements();\n this.slotItemsWrapper.addEventListener('change', this.handleChange.bind(this));\n this.slotItemsWrapper.addEventListener('jump-checkbox-change', this.handleCheckboxChange.bind(this));\n\n let index = 0;\n this.slotItems.forEach((item) => {\n if(index > this.maxElements) {\n item.setAttribute('data-hide', 'true');\n }\n if (item.tagName === 'INPUT' || item.tagName === 'SELECT') {\n this.inputs.push(item);\n if (item.tagName === 'INPUT' && item.type === 'radio') {\n item.name = this.name;\n }\n } else {\n const inputs = item.querySelectorAll('input, select');\n if (inputs.length > 0) {\n inputs.forEach((input) => {\n this.inputs.push(input);\n\n if (input.tagName === 'INPUT' && input.type === 'radio') {\n input.name = this.name;\n }\n });\n }\n }\n index++;\n });\n }\n\n render() {\n return (\n <Host>\n {this.heading && <h5>{this.heading}</h5>}\n <div class=\"filterGroup\">\n <slot ref={(el) => (this.slotItemsWrapper = el as HTMLSlotElement)}></slot>\n </div>\n {this.inputs.length > this.maxElements &&\n <jump-button variant=\"primary\" size=\"small\" text name={this.showMore ? this.otherLabel : this.lessLabel}\n aria-label={this.showMore ? this.otherLabel : this.lessLabel}\n onClick={() => this.handleShowMore() }>\n {this.showMore ? this.otherLabel : this.lessLabel}\n <jump-icon slot=\"suffix\" name={this.showMore ? 'chevron-down' : 'chevron-down'}></jump-icon>\n </jump-button>\n }\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jump-filtergroup.stories.js","sourceRoot":"","sources":["../../../src/components/jump-filtergroup/jump-filtergroup.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE1E,eAAe;IACb,KAAK,EAAE,oCAAoC;IAC3C,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,gBAAgB;QAChB,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,iBAAiB;gBAC9B,YAAY,EAAE,UAAU;aACzB;SACF;QACD,
|
|
1
|
+
{"version":3,"file":"jump-filtergroup.stories.js","sourceRoot":"","sources":["../../../src/components/jump-filtergroup/jump-filtergroup.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAE1E,eAAe;IACb,KAAK,EAAE,oCAAoC;IAC3C,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,gBAAgB;QAChB,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,iBAAiB;gBAC9B,YAAY,EAAE,UAAU;aACzB;SACF;QACD,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,6BAA6B;gBAC1C,YAAY,EAAE,6BAA6B;aAC5C;SACF;QACD,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,qCAAqC;gBAClD,YAAY,EAAE,cAAc;aAC7B;SACF;QACD,SAAS,EAAE;YACT,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,mCAAmC;gBAChD,YAAY,EAAE,aAAa;aAC5B;SACF;QACD,WAAW,EAAE;YACX,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qCAAqC;aACnD;YACD,YAAY,EAAE,CAAC;SAChB;KACF;CACF,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE;IACxB,MAAM,UAAU,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,UAAU,CAAC,qBAAqB,UAAU,sBAAsB,CAAC,CAAC;AAC3E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import { generateAttributesFromArgs, formatHtml} from '../../utils/utils';\n\nexport default {\n title: 'Components/Filters/JumpFilterGroup',\n tags: ['autodocs'],\n argTypes: {\n //list all props\n name: {\n control: {\n type: 'text',\n description: 'Nome del filtro',\n defaultValue: 'tax-name'\n }\n },\n heading: {\n control: {\n type: 'text',\n description: 'Titolo del gruppo di filtri',\n defaultValue: 'Titolo del gruppo di filtri'\n }\n },\n otherLabel: {\n control: {\n type: 'text',\n description: 'Label per il pulsante di espansione',\n defaultValue: 'Mostra altro'\n }\n },\n lessLabel: {\n control: {\n type: 'text',\n description: 'Label per il pulsante di chiusura',\n defaultValue: 'Mostra meno'\n }\n },\n maxElements: {\n control: {\n type: 'number',\n description: 'Numero massimo di elementi visibili'\n },\n defaultValue: 8\n }\n }\n};\n\nconst Template = (args) => {\n const attributes = generateAttributesFromArgs(args);\n return formatHtml(`<jump-filtergroup ${attributes}></jump-filtergroup>`);\n};\n\nexport const Default = Template.bind({});\n"]}
|
|
@@ -22,7 +22,7 @@ export class JumpPagination {
|
|
|
22
22
|
}
|
|
23
23
|
/* --------------------- RENDER ------------------------------- */
|
|
24
24
|
render() {
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: '6ef030ab9b4e21d726894fd4a900d3483b8d641b', class: "JumpPagination" }, h("div", { key: 'd46a4d78bf52013f78da6672a7cc6bce926fb042', class: "JumpPagination__Wrapper" }, h("div", { key: '7fac451a3eeaaf7de386c43986ed77c2d76e8924', class: "indicators" }, h("div", { key: 'be9182cb5c2abfa184327f38d4986ccde82b9261', class: "elements" }, h("span", { key: 'c6cf78cdee38c5b4ad15fcee17fe9e4d4816eca6' }, h("span", { key: 'e1accb40623fd6a19ebbfb3fe479b88721f0144a' }, this.current), " ", this.pagLabel, " ", h("span", { key: 'bb763d0c1c08ca63ebcd2f03bfc5266e17fe3140' }, this.last))), h("div", { key: '3bc88641103f555344af6d0c59cbcadcfadf3a1f', class: "arrow" }, this.showFirstAndLast &&
|
|
26
26
|
// <button
|
|
27
27
|
// onClick={() => {this.current = 1} }
|
|
28
28
|
// disabled={(this.current === 1) ? true : false}>
|
|
@@ -30,14 +30,14 @@ export class JumpPagination {
|
|
|
30
30
|
// disabled={(this.current === 1) ? true : false}
|
|
31
31
|
// ></jump-icon>
|
|
32
32
|
// </button>
|
|
33
|
-
h("jump-button", { key: '
|
|
33
|
+
h("jump-button", { key: '17a5c6fed8aeaf1d01fe554a7ae6febab0ecd662', onClick: () => { this.current = 1; }, variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: (this.current === 1) ? true : false }, " ", h("jump-icon", { key: '01b4f0ebe3d010e73d1e528b18d4b52ff17ccff4', slot: "suffix", name: "chevrons-left" }), " "), h("jump-button", { key: 'c38d217f91fa283e554acbf2f2076043ee235f67', onClick: () => { this.current--; }, variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: (this.current === 1) ? true : false }, " ", h("jump-icon", { key: '0146a1938d8eaca858957c7e3ddd2b722f7ce3f5', slot: "suffix", name: "chevron-left" }), " "), h("jump-button", { key: '63d84b14aedaa84411db9b2ed6cc481369951207', onClick: () => { this.current++; }, variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: (this.current === this.last) ? true : false }, " ", h("jump-icon", { key: '0aec6f6e4141694ca45d41d4c40e1523afa4ac6e', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
|
|
34
34
|
// <button
|
|
35
35
|
// onClick={() => {this.current = this.last}}
|
|
36
36
|
// disabled={(this.current === this.last) ? true : false}
|
|
37
37
|
// >
|
|
38
38
|
// <jump-icon library="fa" category="regular" name="chevrons-right" size="small" slot="prefix"></jump-icon>
|
|
39
39
|
// </button>
|
|
40
|
-
h("jump-button", { key: '
|
|
40
|
+
h("jump-button", { key: '7895c3c9e513d8a54b70b900ecd223a8c9a434a2', onClick: () => { this.current = this.last; }, variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: (this.current === this.last) ? true : false }, " ", h("jump-icon", { key: '1d4f498831de1b30c53cd60d518f05744e2e08aa', slot: "suffix", name: "chevrons-right" }), " "))))));
|
|
41
41
|
}
|
|
42
42
|
static get is() { return "jump-pagination"; }
|
|
43
43
|
static get encapsulation() { return "shadow"; }
|
|
@@ -70,9 +70,9 @@ export class JumpPaginationTable {
|
|
|
70
70
|
/* --------------------- RENDER ------------------------------- */
|
|
71
71
|
render() {
|
|
72
72
|
var _a;
|
|
73
|
-
return (h(Host, { key: '
|
|
74
|
-
h("jump-button", { key: '
|
|
75
|
-
h("jump-button", { key: '
|
|
73
|
+
return (h(Host, { key: '05a8599e55a445dd1e803b8df91ef2771f0b1941', class: "JumpPaginationTable" }, h("div", { key: 'd00f99f46f33558003c3754bf8a65d4cb7ea2ff5', class: "JumpPaginationTable__Wrapper" }, h("div", { key: 'c4122e55c9d7abc0ef2f52dda5613213875c8673', class: "elementsPerPage" }, h("label", { key: '67ecdd093d02469464c29a42d14216614c904440', htmlFor: "elements" }, (_a = this.labelElementsPerPage) !== null && _a !== void 0 ? _a : 'Elements per page'), h("select", { key: 'd8526fe1d2a94916c59d3e10e0b31b469a2ad225', name: "elements", id: "elements", onChange: (e) => this.setElPerPage(e) }, this.elementsRangesArray.map((range) => (h("option", { value: range, selected: (this.elPerPage == range) && true }, range))))), h("div", { key: '1af9a68cdecc2ef679037a41365668f0939651de', class: "indicators" }, h("div", { key: 'dcd792ec4ac23aa5db99766c1e27cc97acefb44c', class: "elements" }, h("span", { key: '5bfecbba59eb57848e035935fcd86fdad4218181' }, h("span", { key: '718a5e16f8fd1d780644ac6c2f66956d35c915a6' }, this.first), " - ", h("span", { key: 'f01228e484b796f9fe0eed3b33db9c0322adc2e9' }, this.last), " ", this.pagLabel, " ", h("span", { key: 'da89d447174eea2a87fc3f6436d41733c7fd75e3' }, this.total))), h("div", { key: 'b79f5d6572d149c0fc20064c30fe2a12f400eaff', class: "arrow" }, this.showFirstAndLast &&
|
|
74
|
+
h("jump-button", { key: '362c778424564efbebfaac46d5885d0f8167b66d', onClick: () => this.doChangePage('first'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: 'd5ddb68feed790ec0acbbbb257feefb2c6b67130', slot: "suffix", name: "chevrons-left" }), " "), h("jump-button", { key: 'f74646227bae22cd864701ed3bb7e8ccfae69fa6', onClick: () => this.doChangePage('previous'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.first === 1 }, " ", h("jump-icon", { key: '6329b6de01096205dd6b5edbf31364d6583c10d3', slot: "suffix", name: "chevron-left" }), " "), h("jump-button", { key: 'f5c1a6298bdc00ad4a5373f66f16ed5249c069a6', onClick: () => this.doChangePage('next'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: '611c0b9618d584dfd5c3bd524563086379e93bd5', slot: "suffix", name: "chevron-right" }), " "), this.showFirstAndLast &&
|
|
75
|
+
h("jump-button", { key: '0aa79cbc25c6706b60aad1dd1c98b802be0dbad5', onClick: () => this.doChangePage('last'), variant: "primary", text: true, size: "small", name: "scopri", value: "value", "aria-label": "Scopri di pi\u00F9", id: "button", onlyIcon: true, disabled: this.last === this.total }, " ", h("jump-icon", { key: 'cd3b8e1fe1335084a1f2707bfd819696f79ab66d', slot: "suffix", name: "chevrons-right" }), " "))))));
|
|
76
76
|
}
|
|
77
77
|
static get is() { return "jump-pagination-table"; }
|
|
78
78
|
static get originalStyleUrls() {
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
align-items: flex-start;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
flex-direction: column;
|
|
6
|
-
gap: 0.
|
|
6
|
+
gap: 0.5rem;
|
|
7
|
+
}
|
|
8
|
+
:host jump-button, :host button {
|
|
9
|
+
--jump-button-padding: 0.5rem;
|
|
7
10
|
}
|
|
8
11
|
:host [data-variant=horizontal] {
|
|
9
12
|
flex-direction: row;
|
|
@@ -22,8 +25,8 @@
|
|
|
22
25
|
border: 1px solid transparent;
|
|
23
26
|
border-radius: 3px;
|
|
24
27
|
padding: 0.5rem;
|
|
25
|
-
height:
|
|
26
|
-
width:
|
|
28
|
+
height: 14px;
|
|
29
|
+
width: 36px;
|
|
27
30
|
font-size: 0.875rem;
|
|
28
31
|
text-align: center;
|
|
29
32
|
}
|
|
@@ -44,11 +44,11 @@ export class JumpQuantity {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
render() {
|
|
47
|
-
return (h(Host, { key: '
|
|
48
|
-
h("jump-button", { key: '
|
|
47
|
+
return (h(Host, { key: 'e0057c54218f8b181669d9d71ca4ffdd81be352d', value: this.value, "data-variant": this.variant, "data-hasbuttons": this.showButtons }, this.label && h("label", { key: '6e22578bc3c99d43674227a32828af7b1d021a6e' }, this.label), h("div", { key: 'e7fcdf05facc434247711e1b22e1ecb1dd1af870', class: `jump-quantity__InnerWrapper` }, this.showButtons &&
|
|
48
|
+
h("jump-button", { key: 'e95187c85caa499e69a3ab99d25c66c1748b2435', onClick: () => this.value = this.value - this.step, disabled: this.value <= this.min, variant: 'neutral', size: 'custom' }, h("jump-icon", { key: '1940100b15763362a83b459344aa17bbcba6dcbb', library: "lucide", name: "minus", size: "small" })), h("input", { key: '60c9c2d3a8c05c8ebcef1ecc57ec9c1eb03708a5', ref: (el) => {
|
|
49
49
|
this.inputEl = el;
|
|
50
50
|
}, type: 'number', value: this.value, onInput: (event) => this.handleChange(event), min: this.min, max: this.max, step: this.step, "aria-hasbuttons": this.showButtons }), this.showButtons &&
|
|
51
|
-
h("jump-button", { key: '
|
|
51
|
+
h("jump-button", { key: '425df591c28196a39e783b48ea9cb505d6b45de8', onClick: () => this.value = this.value + this.step, disabled: this.value >= this.max, variant: 'neutral', size: 'custom' }, h("jump-icon", { key: 'c87adbc6aa13c8405026fcab77ad0f4b0a589b24', library: "lucide", name: "plus", size: "small" })))));
|
|
52
52
|
}
|
|
53
53
|
static get is() { return "jump-quantity"; }
|
|
54
54
|
static get encapsulation() { return "shadow"; }
|