main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[79a0317] | 1 | "use strict";
|
---|
| 2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 3 | exports.TextContainer = void 0;
|
---|
| 4 | var text_1 = require("../css/layout/text");
|
---|
| 5 | var TextContainer = /** @class */ (function () {
|
---|
| 6 | function TextContainer(context, node, styles) {
|
---|
| 7 | this.text = transform(node.data, styles.textTransform);
|
---|
| 8 | this.textBounds = text_1.parseTextBounds(context, this.text, styles, node);
|
---|
| 9 | }
|
---|
| 10 | return TextContainer;
|
---|
| 11 | }());
|
---|
| 12 | exports.TextContainer = TextContainer;
|
---|
| 13 | var transform = function (text, transform) {
|
---|
| 14 | switch (transform) {
|
---|
| 15 | case 1 /* LOWERCASE */:
|
---|
| 16 | return text.toLowerCase();
|
---|
| 17 | case 3 /* CAPITALIZE */:
|
---|
| 18 | return text.replace(CAPITALIZE, capitalize);
|
---|
| 19 | case 2 /* UPPERCASE */:
|
---|
| 20 | return text.toUpperCase();
|
---|
| 21 | default:
|
---|
| 22 | return text;
|
---|
| 23 | }
|
---|
| 24 | };
|
---|
| 25 | var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g;
|
---|
| 26 | var capitalize = function (m, p1, p2) {
|
---|
| 27 | if (m.length > 0) {
|
---|
| 28 | return p1 + p2.toUpperCase();
|
---|
| 29 | }
|
---|
| 30 | return m;
|
---|
| 31 | };
|
---|
| 32 | //# sourceMappingURL=text-container.js.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.