@operato/input 8.0.0 → 8.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,23 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
### [8.0.3](https://github.com/hatiolab/operato/compare/v8.0.2...v8.0.3) (2025-02-14)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @operato/input
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
### [8.0.2](https://github.com/hatiolab/operato/compare/v8.0.1...v8.0.2) (2025-02-14)
|
15
|
+
|
16
|
+
|
17
|
+
### :bug: Bug Fix
|
18
|
+
|
19
|
+
* ontap => onclick for ox-input-select-buttons ([9384e09](https://github.com/hatiolab/operato/commit/9384e09120f2c16890bfda943cf07695689ae25a))
|
20
|
+
|
21
|
+
|
22
|
+
|
6
23
|
## [8.0.0](https://github.com/hatiolab/operato/compare/v7.1.33...v8.0.0) (2025-01-14)
|
7
24
|
|
8
25
|
**Note:** Version bump only for package @operato/input
|
@@ -14,6 +14,6 @@ export declare class OxInputSelectButtons extends OxFormField {
|
|
14
14
|
options: Option[];
|
15
15
|
multiple: boolean;
|
16
16
|
render(): import("lit-html").TemplateResult<1>;
|
17
|
-
|
17
|
+
onClick(e: MouseEvent | TouchEvent): void;
|
18
18
|
}
|
19
19
|
export {};
|
@@ -34,13 +34,13 @@ let OxInputSelectButtons = class OxInputSelectButtons extends OxFormField {
|
|
34
34
|
data-value=${value}
|
35
35
|
label=${display}
|
36
36
|
?selected=${values.includes(value)}
|
37
|
-
@
|
37
|
+
@click=${(e) => !this.disabled && this.onClick(e)}
|
38
38
|
></md-filter-chip>
|
39
39
|
`)}
|
40
40
|
</md-chip-set>
|
41
41
|
`;
|
42
42
|
}
|
43
|
-
|
43
|
+
onClick(e) {
|
44
44
|
e.stopPropagation();
|
45
45
|
const target = e.target;
|
46
46
|
const value = target.getAttribute('data-value');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ox-input-select-buttons.js","sourceRoot":"","sources":["../../src/ox-input-select-buttons.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,oCAAoC,CAAA;AAC3C,OAAO,iCAAiC,CAAA;AAExC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAMtC,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,WAAW;IAA9C;;QAYsB,UAAK,GAAkC,EAAE,CAAA;QACzC,YAAO,GAAa,EAAE,CAAA;QACpB,aAAQ,GAAY,KAAK,CAAA;IA4CxD,CAAC;aAzDQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;GASlB,AATY,CASZ;IAMD,MAAM;QACJ,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAC7D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QAE3G,OAAO,IAAI,CAAA;;UAEL,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CACnB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,CAAA;;2BAEX,KAAK;sBACV,OAAO;0BACH,MAAM,CAAC,QAAQ,CAAC,KAAK,C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AE,IAAI,EAAE,KAAK,EAAE,CAAC;mDAA0C;AACzC;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;qDAAuB;AACpB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sDAA0B;AAd3C,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CA0DhC","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/web/chips/filter-chip.js'\nimport '@material/web/chips/chip-set.js'\n\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { OxFormField } from './ox-form-field'\nimport { MdFilterChip } from '@material/web/chips/filter-chip.js'\n\ntype Option = { display: string; value: string }\n\n@customElement('ox-input-select-buttons')\nexport class OxInputSelectButtons extends OxFormField {\n static styles = css`\n :host {\n display: flex;\n flex-flow: row;\n flex-wrap: wrap;\n gap: var(--spacing-medium);\n\n text-transform: capitalize;\n }\n `\n\n @property({ type: Array }) value: string[] | string | undefined = []\n @property({ type: Array }) options: Option[] = []\n @property({ type: Boolean }) multiple: boolean = false\n\n render() {\n const options = this.options.filter(option => !!option.value)\n const values = this.value instanceof Array ? this.value : typeof this.value == 'string' ? [this.value] : []\n\n return html`\n <md-chip-set>\n ${(options || []).map(\n ({ display, value }) => html`\n <md-filter-chip\n data-value=${value}\n label=${display}\n ?selected=${values.includes(value)}\n @click=${(e: MouseEvent | TouchEvent) => !this.disabled && this.onClick(e)}\n ></md-filter-chip>\n `\n )}\n </md-chip-set>\n `\n }\n\n onClick(e: MouseEvent | TouchEvent) {\n e.stopPropagation()\n\n const target = e.target as MdFilterChip\n const value = target.getAttribute('data-value') as string\n\n if (this.multiple) {\n const values = this.value instanceof Array ? this.value : typeof this.value == 'string' ? [this.value] : []\n\n const idx = (this.value || []).indexOf(value)\n if (idx != -1) {\n values.splice(idx, 1)\n } else {\n values.push(value)\n }\n this.value = [...values]\n } else {\n this.value = this.value === value ? undefined : value\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: this.value }))\n }\n}\n"]}
|