@aurelia2-mdc-web/button
Advanced tools
| import { __decorate } from "tslib"; | ||
| import { lifecycleHooks } from 'aurelia'; | ||
| import { templateCompilerHooks } from 'aurelia'; | ||
| let EnhanceMdcButton = class EnhanceMdcButton { | ||
| define(controller) { | ||
| const template = controller.definition.template; | ||
| if (template) { | ||
| const actions = template.querySelectorAll('[mdc-button]'); | ||
| for (const i of Array.from(actions)) { | ||
| i.setAttribute('as-element', 'mdc-button'); | ||
| } | ||
| } | ||
| compiling(template) { | ||
| template.innerHTML = template.innerHTML.replaceAll('mdc-button=""', 'as-element="mdc-button"'); | ||
| } | ||
| }; | ||
| EnhanceMdcButton = __decorate([ | ||
| lifecycleHooks() | ||
| templateCompilerHooks | ||
| ], EnhanceMdcButton); | ||
| export { EnhanceMdcButton }; | ||
| //# sourceMappingURL=enhance-mdc-button.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"enhance-mdc-button.js","sourceRoot":"","sources":["../src/enhance-mdc-button.ts"],"names":[],"mappings":";AACA,OAAO,EAA2B,cAAc,EAAE,MAAM,SAAS,CAAC;AAGlE,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAC3B,MAAM,CAAC,UAA6C;QAClD,MAAM,QAAQ,GAAG,UAAU,CAAC,UAAU,CAAC,QAA4B,CAAC;QAEpE,IAAI,QAAQ,EAAE;YACZ,MAAM,OAAO,GAAG,QAAQ,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;YAC1D,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;gBACnC,CAAC,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;aAC5C;SACF;IACH,CAAC;CACF,CAAA;AAXY,gBAAgB;IAD5B,cAAc,EAAE;GACJ,gBAAgB,CAW5B;SAXY,gBAAgB","sourcesContent":["import { IDryCustomElementController, PartialCustomElementDefinition } from '@aurelia/runtime-html';\nimport { ICustomElementViewModel, lifecycleHooks } from 'aurelia';\n\n@lifecycleHooks()\nexport class EnhanceMdcButton implements ICustomElementViewModel {\n define(controller: IDryCustomElementController<this>): void | PartialCustomElementDefinition {\n const template = controller.definition.template as DocumentFragment;\n\n if (template) {\n const actions = template.querySelectorAll('[mdc-button]');\n for (const i of Array.from(actions)) {\n i.setAttribute('as-element', 'mdc-button');\n }\n }\n }\n}\n"]} | ||
| {"version":3,"file":"enhance-mdc-button.js","sourceRoot":"","sources":["../src/enhance-mdc-button.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGhD,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAC3B,SAAS,CAAC,QAA2C;QACnD,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAAC;IACjG,CAAC;CACF,CAAA;AAJY,gBAAgB;IAD5B,qBAAqB;GACT,gBAAgB,CAI5B;SAJY,gBAAgB","sourcesContent":["import { templateCompilerHooks } from 'aurelia';\n\n@templateCompilerHooks\nexport class EnhanceMdcButton {\n compiling(template: HTMLElement | HTMLTemplateElement) {\n template.innerHTML = template.innerHTML.replaceAll('mdc-button=\"\"', 'as-element=\"mdc-button\"');\n }\n}\n"]} |
@@ -1,5 +0,3 @@ | ||
| import { IDryCustomElementController, PartialCustomElementDefinition } from '@aurelia/runtime-html'; | ||
| import { ICustomElementViewModel } from 'aurelia'; | ||
| export declare class EnhanceMdcButton implements ICustomElementViewModel { | ||
| define(controller: IDryCustomElementController<this>): void | PartialCustomElementDefinition; | ||
| export declare class EnhanceMdcButton { | ||
| compiling(template: HTMLElement | HTMLTemplateElement): void; | ||
| } |
+3
-3
| { | ||
| "name": "@aurelia2-mdc-web/button", | ||
| "version": "1.0.11", | ||
| "version": "1.0.12", | ||
| "publishConfig": { | ||
@@ -44,6 +44,6 @@ "access": "public" | ||
| "dependencies": { | ||
| "@aurelia2-mdc-web/base": "1.0.11", | ||
| "@aurelia2-mdc-web/ripple": "1.0.11", | ||
| "@aurelia2-mdc-web/base": "1.0.12", | ||
| "@aurelia2-mdc-web/ripple": "1.0.12", | ||
| "@material/button": "^14.0.0" | ||
| } | ||
| } |
13167
-6.54%196
-3.92%+ Added
+ Added
- Removed
- Removed