@italia/transfer 1.0.0-alpha.10
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/AUTHORS +2 -0
- package/LICENSE +11 -0
- package/custom-elements.json +799 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/it-transfer-item.d.ts +21 -0
- package/dist/src/it-transfer-item.d.ts.map +1 -0
- package/dist/src/it-transfer-item.js +39 -0
- package/dist/src/it-transfer-item.js.map +1 -0
- package/dist/src/it-transfer.d.ts +59 -0
- package/dist/src/it-transfer.d.ts.map +1 -0
- package/dist/src/it-transfer.js +4099 -0
- package/dist/src/it-transfer.js.map +1 -0
- package/dist/src/locales/it.d.ts +4 -0
- package/dist/src/locales/it.d.ts.map +1 -0
- package/dist/src/types.d.ts +17 -0
- package/dist/src/types.d.ts.map +1 -0
- package/package.json +75 -0
- package/styles/globals.scss +9 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { ItTransfer } from './it-transfer.js';
|
|
2
|
+
export { ItTransferItem } from './it-transfer-item.js';
|
|
3
|
+
import '../tslib.es6-Cv888lzs.js';
|
|
4
|
+
import 'lit/directive.js';
|
|
5
|
+
import 'lit';
|
|
6
|
+
import 'lit/decorators.js';
|
|
7
|
+
import 'lit/directives/live.js';
|
|
8
|
+
import 'lit/directives/repeat.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* A single transferable item. Place as a direct child of `<it-transfer>`.
|
|
4
|
+
* The element's text content is used as the item label.
|
|
5
|
+
*
|
|
6
|
+
* @slot - The label text for this item.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ItTransferItem extends LitElement {
|
|
9
|
+
/** The value submitted as part of the transfer's form value when in the target list. */
|
|
10
|
+
value: string;
|
|
11
|
+
/** If set, the item cannot be transferred. */
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
/** If set, the item starts in the target (right) list on initialisation. */
|
|
14
|
+
target: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
'it-transfer-item': ItTransferItem;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=it-transfer-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"it-transfer-item.d.ts","sourceRoot":"","sources":["../../src/it-transfer-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGjC;;;;;GAKG;AACH,qBACa,cAAe,SAAQ,UAAU;IAC5C,wFAAwF;IAExF,KAAK,SAAM;IAEX,8CAA8C;IAE9C,QAAQ,UAAS;IAEjB,4EAA4E;IAE5E,MAAM,UAAS;CAChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { _ as __decorate, a as __metadata } from '../tslib.es6-Cv888lzs.js';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import { property, customElement } from 'lit/decorators.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A single transferable item. Place as a direct child of `<it-transfer>`.
|
|
7
|
+
* The element's text content is used as the item label.
|
|
8
|
+
*
|
|
9
|
+
* @slot - The label text for this item.
|
|
10
|
+
*/
|
|
11
|
+
let ItTransferItem = class ItTransferItem extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
/** The value submitted as part of the transfer's form value when in the target list. */
|
|
15
|
+
this.value = '';
|
|
16
|
+
/** If set, the item cannot be transferred. */
|
|
17
|
+
this.disabled = false;
|
|
18
|
+
/** If set, the item starts in the target (right) list on initialisation. */
|
|
19
|
+
this.target = false;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
__decorate([
|
|
23
|
+
property({ type: String, reflect: true }),
|
|
24
|
+
__metadata("design:type", Object)
|
|
25
|
+
], ItTransferItem.prototype, "value", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
property({ type: Boolean, reflect: true }),
|
|
28
|
+
__metadata("design:type", Object)
|
|
29
|
+
], ItTransferItem.prototype, "disabled", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
property({ type: Boolean, reflect: true }),
|
|
32
|
+
__metadata("design:type", Object)
|
|
33
|
+
], ItTransferItem.prototype, "target", void 0);
|
|
34
|
+
ItTransferItem = __decorate([
|
|
35
|
+
customElement('it-transfer-item')
|
|
36
|
+
], ItTransferItem);
|
|
37
|
+
|
|
38
|
+
export { ItTransferItem };
|
|
39
|
+
//# sourceMappingURL=it-transfer-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"it-transfer-item.js","sources":["../../../src/it-transfer-item.ts"],"sourcesContent":["import { LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\n/**\n * A single transferable item. Place as a direct child of `<it-transfer>`.\n * The element's text content is used as the item label.\n *\n * @slot - The label text for this item.\n */\n@customElement('it-transfer-item')\nexport class ItTransferItem extends LitElement {\n /** The value submitted as part of the transfer's form value when in the target list. */\n @property({ type: String, reflect: true })\n value = '';\n\n /** If set, the item cannot be transferred. */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /** If set, the item starts in the target (right) list on initialisation. */\n @property({ type: Boolean, reflect: true })\n target = false;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-transfer-item': ItTransferItem;\n }\n}\n"],"names":[],"mappings":";;;;AAGA;;;;;AAKG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU,CAAA;AAAvC,IAAA,WAAA,GAAA;;;QAGL,IAAA,CAAA,KAAK,GAAG,EAAE;;QAIV,IAAA,CAAA,QAAQ,GAAG,KAAK;;QAIhB,IAAA,CAAA,MAAM,GAAG,KAAK;IAChB;;AATE,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC/B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAIX,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC1B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAIjB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC5B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAXJ,cAAc,GAAA,UAAA,CAAA;IAD1B,aAAa,CAAC,kBAAkB;AACpB,CAAA,EAAA,cAAc,CAY1B;;;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { FormControl, FormControlController } from '@italia/globals';
|
|
2
|
+
/**
|
|
3
|
+
* A dual-list transfer component that allows moving items between a source and a target list.
|
|
4
|
+
* Integrates with native `<form>` elements via the FormControl API.
|
|
5
|
+
*
|
|
6
|
+
* @fires {CustomEvent<TransferEventDetail>} it-transfer - Fired (cancelable) before items are transferred/reset. Prevent default to cancel.
|
|
7
|
+
* @fires {CustomEvent<{value: string, el: HTMLElement}>} it-change - Fired after the target list changes.
|
|
8
|
+
*
|
|
9
|
+
* @slot - One or more `<it-transfer-item>` elements.
|
|
10
|
+
*/
|
|
11
|
+
export declare class ItTransfer extends FormControl {
|
|
12
|
+
static styles: import("lit").CSSResultGroup;
|
|
13
|
+
protected readonly formControlController: FormControlController;
|
|
14
|
+
/** Override i18n label for the source (left) list header. */
|
|
15
|
+
sourceLabel?: string;
|
|
16
|
+
/** Override i18n label for the target (right) list header. */
|
|
17
|
+
targetLabel?: string;
|
|
18
|
+
/** Override i18n aria-label for the transfer (→) button. */
|
|
19
|
+
transferLabel?: string;
|
|
20
|
+
/** Override i18n aria-label for the back-transfer (←) button. */
|
|
21
|
+
backtransferLabel?: string;
|
|
22
|
+
/** Override i18n aria-label for the reset (↺) button. */
|
|
23
|
+
resetLabel?: string;
|
|
24
|
+
private _slottedItems;
|
|
25
|
+
private _sourceItems;
|
|
26
|
+
private _targetItems;
|
|
27
|
+
private _sourceChecked;
|
|
28
|
+
private _targetChecked;
|
|
29
|
+
/** Snapshot of the initial state for reset(). Set once on first slotchange. */
|
|
30
|
+
private _initialSource;
|
|
31
|
+
private _initialTarget;
|
|
32
|
+
get validity(): ValidityState;
|
|
33
|
+
checkValidity(): boolean;
|
|
34
|
+
reportValidity(): boolean;
|
|
35
|
+
protected handleValidationMessages(): void;
|
|
36
|
+
private _setFromFormValue;
|
|
37
|
+
private _syncValue;
|
|
38
|
+
connectedCallback(): void;
|
|
39
|
+
private _handleSlotChange;
|
|
40
|
+
private _dispatch;
|
|
41
|
+
/** Move checked source items to the target list. */
|
|
42
|
+
transfer(): void;
|
|
43
|
+
/** Move checked target items back to the source list. */
|
|
44
|
+
backtransfer(): void;
|
|
45
|
+
/** Reset both lists to their initial state. */
|
|
46
|
+
reset(): void;
|
|
47
|
+
private _toggleItem;
|
|
48
|
+
private _toggleAll;
|
|
49
|
+
private _getHeaderState;
|
|
50
|
+
private _renderList;
|
|
51
|
+
private _renderButtons;
|
|
52
|
+
render(): import("lit").TemplateResult<1>;
|
|
53
|
+
}
|
|
54
|
+
declare global {
|
|
55
|
+
interface HTMLElementTagNameMap {
|
|
56
|
+
'it-transfer': ItTransfer;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=it-transfer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"it-transfer.d.ts","sourceRoot":"","sources":["../../src/it-transfer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAcrE;;;;;;;;GAQG;AACH,qBACa,UAAW,SAAQ,WAAW;IACzC,MAAM,CAAC,MAAM,+BAAU;IAEvB,mBAA4B,qBAAqB,EAAE,qBAAqB,CAUrE;IAEH,6DAA6D;IAE7D,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,8DAA8D;IAE9D,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,4DAA4D;IAE5D,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,iEAAiE;IAEjE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,yDAAyD;IAEzD,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,OAAO,CAAC,aAAa,CAAoB;IAGzC,OAAO,CAAC,YAAY,CAA0B;IAG9C,OAAO,CAAC,YAAY,CAA0B;IAG9C,OAAO,CAAC,cAAc,CAA0B;IAGhD,OAAO,CAAC,cAAc,CAA0B;IAEhD,+EAA+E;IAC/E,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,cAAc,CAA0B;IAIhD,IAAa,QAAQ,IAAI,aAAa,CAerC;IAEQ,aAAa,IAAI,OAAO;IAKxB,cAAc,IAAI,OAAO;cAYf,wBAAwB;IAS3C,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,UAAU;IAeT,iBAAiB;IAM1B,OAAO,CAAC,iBAAiB;IA8BzB,OAAO,CAAC,SAAS;IAsBjB,oDAAoD;IACpD,QAAQ;IAuBR,yDAAyD;IACzD,YAAY;IAuBZ,+CAA+C;IAC/C,KAAK;IAeL,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,UAAU;IAalB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,WAAW;IA2DnB,OAAO,CAAC,cAAc;IA+Eb,MAAM;CAuChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|