@shoper/phoenix_design_system 0.5.2 → 0.6.0
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/build/cjs/packages/phoenix/src/controllers/btn_controller.js +28 -0
- package/build/cjs/packages/phoenix/src/controllers/btn_controller.js.map +1 -0
- package/build/cjs/packages/phoenix/src/index.js +2 -0
- package/build/cjs/packages/phoenix/src/index.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/btn_controller.d.ts +8 -0
- package/build/esm/packages/phoenix/src/controllers/btn_controller.js +24 -0
- package/build/esm/packages/phoenix/src/controllers/btn_controller.js.map +1 -0
- package/build/esm/packages/phoenix/src/index.d.ts +1 -0
- package/build/esm/packages/phoenix/src/index.js +1 -0
- package/build/esm/packages/phoenix/src/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('lit');
|
|
6
|
+
|
|
7
|
+
class BtnController {
|
|
8
|
+
constructor(host, callback) {
|
|
9
|
+
(this.host = host).addController(this);
|
|
10
|
+
this.host.tabIndex = 0;
|
|
11
|
+
this.host.setAttribute('role', 'button');
|
|
12
|
+
this.callback = (ev) => {
|
|
13
|
+
const isEnterOrSpacebarPressed = ev.code === 'Enter' || ev.code === 'Space';
|
|
14
|
+
if (isEnterOrSpacebarPressed) {
|
|
15
|
+
callback();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
hostConnected() {
|
|
20
|
+
this.host.addEventListener('keydown', this.callback);
|
|
21
|
+
}
|
|
22
|
+
hostDisconnected() {
|
|
23
|
+
this.host.removeEventListener('keydown', this.callback);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
exports.BtnController = BtnController;
|
|
28
|
+
//# sourceMappingURL=btn_controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -15,6 +15,7 @@ var modal_body = require('./components/modal/modal_body.js');
|
|
|
15
15
|
var modal_footer = require('./components/modal/modal_footer.js');
|
|
16
16
|
var modal_header = require('./components/modal/modal_header.js');
|
|
17
17
|
var modal_close = require('./components/modal/modal_close.js');
|
|
18
|
+
var btn_controller = require('./controllers/btn_controller.js');
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
|
|
@@ -81,4 +82,5 @@ Object.defineProperty(exports, 'HModalClose', {
|
|
|
81
82
|
return modal_close.HModalClose;
|
|
82
83
|
}
|
|
83
84
|
});
|
|
85
|
+
exports.BtnController = btn_controller.BtnController;
|
|
84
86
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
export declare class BtnController implements ReactiveController {
|
|
3
|
+
host: ReactiveControllerHost & HTMLElement;
|
|
4
|
+
callback: (ev: KeyboardEvent) => void;
|
|
5
|
+
constructor(host: ReactiveControllerHost & HTMLElement, callback: () => void);
|
|
6
|
+
hostConnected(): void;
|
|
7
|
+
hostDisconnected(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import 'lit';
|
|
2
|
+
|
|
3
|
+
class BtnController {
|
|
4
|
+
constructor(host, callback) {
|
|
5
|
+
(this.host = host).addController(this);
|
|
6
|
+
this.host.tabIndex = 0;
|
|
7
|
+
this.host.setAttribute('role', 'button');
|
|
8
|
+
this.callback = (ev) => {
|
|
9
|
+
const isEnterOrSpacebarPressed = ev.code === 'Enter' || ev.code === 'Space';
|
|
10
|
+
if (isEnterOrSpacebarPressed) {
|
|
11
|
+
callback();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
hostConnected() {
|
|
16
|
+
this.host.addEventListener('keydown', this.callback);
|
|
17
|
+
}
|
|
18
|
+
hostDisconnected() {
|
|
19
|
+
this.host.removeEventListener('keydown', this.callback);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { BtnController };
|
|
24
|
+
//# sourceMappingURL=btn_controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -12,3 +12,4 @@ export { HModalBody } from './components/modal/modal_body';
|
|
|
12
12
|
export { HModalFooter } from './components/modal/modal_footer';
|
|
13
13
|
export { HModalHeader } from './components/modal/modal_header';
|
|
14
14
|
export { HModalClose } from './components/modal/modal_close';
|
|
15
|
+
export { BtnController } from './controllers/btn_controller';
|
|
@@ -11,4 +11,5 @@ export { HModalBody } from './components/modal/modal_body.js';
|
|
|
11
11
|
export { HModalFooter } from './components/modal/modal_footer.js';
|
|
12
12
|
export { HModalHeader } from './components/modal/modal_header.js';
|
|
13
13
|
export { HModalClose } from './components/modal/modal_close.js';
|
|
14
|
+
export { BtnController } from './controllers/btn_controller.js';
|
|
14
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|