generator-white-label 3.0.0 → 5.0.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/README.md +140 -81
- package/app/404.hbs +20 -0
- package/app/README.md +19 -0
- package/app/assets/data/view/toolkit/colors.json +17 -0
- package/app/assets/data/view/toolkit/components.json +39 -0
- package/app/assets/data/view/toolkit/elements.json +119 -0
- package/app/assets/data/view/toolkit/grids.json +17 -0
- package/app/assets/data/view/toolkit/icons.json +17 -0
- package/app/assets/data/view/toolkit/index.json +17 -0
- package/app/assets/data/view/toolkit/type.json +17 -0
- package/app/assets/font/opensans/stylesheet.css +20 -60
- package/app/assets/image/demo/fallback.avif +0 -0
- package/app/assets/image/demo/fallback.jpg +0 -0
- package/app/assets/image/demo/fallback.webp +0 -0
- package/app/assets/image/demo/large.avif +0 -0
- package/app/assets/image/demo/large.webp +0 -0
- package/app/assets/image/demo/small.avif +0 -0
- package/app/assets/image/demo/small.webp +0 -0
- package/app/assets/markup/element/a.hbs +29 -0
- package/app/assets/markup/element/button.hbs +30 -0
- package/app/assets/markup/element/div.hbs +11 -0
- package/app/assets/markup/element/head.hbs +78 -0
- package/app/assets/markup/element/iframe.hbs +20 -0
- package/app/assets/markup/element/img.hbs +30 -0
- package/app/assets/markup/element/input.hbs +43 -0
- package/app/assets/markup/element/label.hbs +14 -0
- package/app/assets/markup/element/legend.hbs +5 -0
- package/app/assets/markup/element/meta.hbs +11 -0
- package/app/assets/markup/element/nav.hbs +13 -0
- package/app/assets/markup/element/p.hbs +8 -0
- package/app/assets/markup/element/picture.hbs +58 -0
- package/app/assets/markup/element/script.hbs +3 -0
- package/app/assets/markup/element/select.hbs +35 -0
- package/app/assets/markup/element/span.hbs +8 -0
- package/app/assets/markup/element/svg.hbs +11 -0
- package/app/assets/markup/element/table.hbs +50 -0
- package/app/assets/markup/element/textarea.hbs +24 -0
- package/app/assets/markup/element/ul.hbs +13 -0
- package/app/assets/markup/modal/modal-example-1.handlebars +8 -0
- package/app/assets/markup/toolkit/accessibility-skip-to-element-1.handlebars +1 -0
- package/app/assets/markup/toolkit/accessibility-speaker-1.handlebars +1 -0
- package/app/assets/markup/toolkit/anchor-1.handlebars +1 -0
- package/app/assets/markup/toolkit/button-1.handlebars +1 -0
- package/app/assets/markup/toolkit/footer-1.handlebars +3 -0
- package/app/assets/markup/toolkit/header-1.handlebars +1 -0
- package/app/assets/markup/toolkit/heading-1.handlebars +1 -0
- package/app/assets/markup/toolkit/heading-2.handlebars +1 -0
- package/app/assets/markup/toolkit/heading-3.handlebars +1 -0
- package/app/assets/markup/toolkit/heading-4.handlebars +1 -0
- package/app/assets/markup/toolkit/image-1.handlebars +1 -0
- package/app/assets/markup/toolkit/input-checkbox-1.handlebars +1 -0
- package/app/assets/markup/toolkit/input-error-1.handlebars +8 -0
- package/app/assets/markup/toolkit/input-radio-1.handlebars +1 -0
- package/app/assets/markup/toolkit/input-text-1.handlebars +1 -0
- package/app/assets/markup/toolkit/label-1.handlebars +1 -0
- package/app/assets/markup/toolkit/legend-1.handlebars +1 -0
- package/app/assets/markup/toolkit/list-1.handlebars +1 -0
- package/app/assets/markup/toolkit/modal-1.handlebars +4 -0
- package/app/assets/markup/toolkit/nav-1.handlebars +1 -0
- package/app/assets/markup/toolkit/picture-1.handlebars +1 -0
- package/app/assets/markup/toolkit/select-1.handlebars +1 -0
- package/app/assets/markup/toolkit/table-1.handlebars +1 -0
- package/app/assets/markup/toolkit/text-1.handlebars +1 -0
- package/app/assets/markup/toolkit/textarea-1.handlebars +1 -0
- package/app/assets/markup/toolkit/youtube-player-1.handlebars +1 -0
- package/app/assets/script/api/facebook.ts +41 -0
- package/app/assets/script/api/youtube.ts +22 -0
- package/app/assets/script/index.ts +2 -0
- package/app/assets/script/mediator/global.ts +4 -0
- package/app/assets/script/model/singletons/countries.ts +5 -0
- package/app/assets/script/model/singletons/global.ts +5 -0
- package/app/assets/script/model/singletons/states.ts +5 -0
- package/app/assets/script/model/user.ts +4 -0
- package/app/assets/script/toolkit.ts +11 -0
- package/app/assets/script/types.d.ts +16 -0
- package/app/assets/script/utility/ajax.ts +15 -0
- package/app/assets/script/utility/form.ts +119 -0
- package/app/assets/script/utility/{regex.js → regex.ts} +15 -6
- package/app/assets/script/utility/share.ts +77 -0
- package/app/assets/script/utility/string.ts +148 -0
- package/app/assets/script/view/default.tsx +14 -0
- package/app/assets/script/view/toolkit/youtube-player-1.ts +31 -0
- package/app/assets/style/base/_toolkit.scss +31 -15
- package/app/assets/style/base/components/_modal-1.scss +80 -0
- package/app/assets/style/base/components/_sticky-1.scss +19 -0
- package/app/assets/style/base/components/_tabpanel-1.scss +115 -0
- package/app/assets/style/base/components/_tabpanel-2.scss +64 -0
- package/app/assets/style/base/components/_tabpanel-base-1.scss +13 -0
- package/app/assets/style/base/components/_youtube-player-1.scss +16 -0
- package/app/assets/style/base/elements/_anchors.scss +12 -0
- package/app/assets/style/base/elements/_buttons.scss +15 -0
- package/app/assets/style/base/elements/_fieldsets.scss +9 -0
- package/app/assets/style/base/elements/_images.scss +6 -2
- package/app/assets/style/base/elements/_inputs.scss +70 -0
- package/app/assets/style/base/elements/_labels.scss +8 -0
- package/app/assets/style/base/elements/_landmarks.scss +3 -0
- package/app/assets/style/base/elements/_legends.scss +11 -0
- package/app/assets/style/base/elements/_lists.scss +8 -1
- package/app/assets/style/base/elements/_tables.scss +32 -1
- package/app/assets/style/base/layouts/_staggered-1.scss +29 -0
- package/app/assets/style/base/type/_fonts.scss +39 -1
- package/app/assets/style/base/type/_headings.scss +29 -0
- package/app/assets/style/base/type/_text.scss +2 -0
- package/app/assets/style/base/utilities/_accessibility.scss +5 -2
- package/app/assets/style/base/utilities/_functions.scss +62 -9
- package/app/assets/style/global.scss +108 -10
- package/app/assets/style/print.scss +2 -3
- package/app/assets/style/toolkit.scss +387 -0
- package/app/index.hbs +21 -0
- package/app/package.json +1 -0
- package/app/toolkit/colors.hbs +102 -0
- package/app/toolkit/components.hbs +261 -0
- package/app/toolkit/elements.hbs +497 -0
- package/app/toolkit/grids.hbs +413 -0
- package/app/toolkit/icons.hbs +87 -0
- package/app/toolkit/index.hbs +144 -0
- package/app/toolkit/type.hbs +120 -0
- package/dist/app/assets/data/coutries.json +992 -0
- package/dist/app/assets/data/states.json +204 -0
- package/dist/app/assets/script/api/facebook.d.ts +8 -0
- package/dist/app/assets/script/api/facebook.js +42 -0
- package/dist/app/assets/script/api/facebook.js.map +1 -0
- package/dist/app/assets/script/api/youtube.d.ts +8 -0
- package/dist/app/assets/script/api/youtube.js +22 -0
- package/dist/app/assets/script/api/youtube.js.map +1 -0
- package/dist/app/assets/script/index.d.ts +2 -0
- package/dist/app/assets/script/index.js +2 -0
- package/dist/app/assets/script/index.js.map +1 -0
- package/dist/app/assets/script/mediator/global.d.ts +4 -0
- package/dist/app/assets/script/mediator/global.js +4 -0
- package/dist/app/assets/script/mediator/global.js.map +1 -0
- package/dist/app/assets/script/model/singletons/countries.d.ts +20 -0
- package/dist/app/assets/script/model/singletons/countries.js +5 -0
- package/dist/app/assets/script/model/singletons/countries.js.map +1 -0
- package/dist/app/assets/script/model/singletons/global.d.ts +20 -0
- package/dist/app/assets/script/model/singletons/global.js +5 -0
- package/dist/app/assets/script/model/singletons/global.js.map +1 -0
- package/dist/app/assets/script/model/singletons/states.d.ts +20 -0
- package/dist/app/assets/script/model/singletons/states.js +5 -0
- package/dist/app/assets/script/model/singletons/states.js.map +1 -0
- package/dist/app/assets/script/model/user.d.ts +4 -0
- package/dist/app/assets/script/model/user.js +6 -0
- package/dist/app/assets/script/model/user.js.map +1 -0
- package/dist/app/assets/script/toolkit.d.ts +1 -0
- package/dist/app/assets/script/toolkit.js +7 -0
- package/dist/app/assets/script/toolkit.js.map +1 -0
- package/dist/app/assets/script/utility/ajax.d.ts +8 -0
- package/dist/app/assets/script/utility/ajax.js +17 -0
- package/dist/app/assets/script/utility/ajax.js.map +1 -0
- package/dist/app/assets/script/utility/form.d.ts +64 -0
- package/dist/app/assets/script/utility/form.js +111 -0
- package/dist/app/assets/script/utility/form.js.map +1 -0
- package/dist/app/assets/script/utility/regex.d.ts +14 -0
- package/dist/app/assets/script/utility/regex.js +27 -0
- package/dist/app/assets/script/utility/regex.js.map +1 -0
- package/dist/app/assets/script/utility/share.d.ts +68 -0
- package/dist/app/assets/script/utility/share.js +81 -0
- package/dist/app/assets/script/utility/share.js.map +1 -0
- package/dist/app/assets/script/utility/string.d.ts +64 -0
- package/dist/app/assets/script/utility/string.js +135 -0
- package/dist/app/assets/script/utility/string.js.map +1 -0
- package/dist/app/assets/script/view/default.d.ts +11 -0
- package/dist/app/assets/script/view/default.js +15 -0
- package/dist/app/assets/script/view/default.js.map +1 -0
- package/dist/app/assets/script/view/toolkit/youtube-player-1.d.ts +23 -0
- package/dist/app/assets/script/view/toolkit/youtube-player-1.js +32 -0
- package/dist/app/assets/script/view/toolkit/youtube-player-1.js.map +1 -0
- package/dist/generators/app/index.d.ts +18 -0
- package/dist/generators/app/index.js +59 -0
- package/dist/generators/app/index.js.map +1 -0
- package/dist/scripts/build.d.ts +22 -0
- package/dist/scripts/build.js +158 -0
- package/dist/scripts/build.js.map +1 -0
- package/generators/app/index.js +2 -43
- package/generators/app/index.ts +61 -0
- package/package.json +78 -109
- package/scripts/build.ts +175 -0
- package/tsconfig.site.json +26 -0
- package/.babelrc +0 -7
- package/.editorconfig +0 -13
- package/.eslintrc +0 -64
- package/.htmllintrc +0 -6
- package/.npmignore +0 -12
- package/.sass-lint.yml +0 -16
- package/.travis.yml +0 -18
- package/app/assets/font/opensans/generator_config.txt +0 -5
- package/app/assets/font/opensans/opensans-bold-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-bold-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-bold-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-bold-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-bolditalic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-bolditalic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-bolditalic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-bolditalic-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-extrabold-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-extrabold-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-extrabold-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-extrabold-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-extrabolditalic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-extrabolditalic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-extrabolditalic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-extrabolditalic-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-italic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-italic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-italic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-italic-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-light-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-light-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-light-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-light-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-lightitalic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-lightitalic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-lightitalic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-lightitalic-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-regular-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-regular-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-regular-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-regular-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-semibold-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-semibold-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-semibold-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-semibold-webfont.woff +0 -0
- package/app/assets/font/opensans/opensans-semibolditalic-webfont.eot +0 -0
- package/app/assets/font/opensans/opensans-semibolditalic-webfont.svg +0 -1824
- package/app/assets/font/opensans/opensans-semibolditalic-webfont.ttf +0 -0
- package/app/assets/font/opensans/opensans-semibolditalic-webfont.woff +0 -0
- package/app/assets/font/opensans/specimen_files/grid_12-825-55-15.css +0 -129
- package/app/assets/font/opensans/specimen_files/specimen_stylesheet.css +0 -396
- package/app/assets/script/index.js +0 -11
- package/app/assets/script/mediator/global.js +0 -5
- package/app/assets/script/model/singletons/countries.js +0 -6
- package/app/assets/script/model/singletons/global.js +0 -6
- package/app/assets/script/model/singletons/states.js +0 -6
- package/app/assets/script/model/user.js +0 -5
- package/app/assets/script/utility/form.js +0 -86
- package/app/assets/script/utility/share.js +0 -52
- package/app/assets/script/utility/string.js +0 -70
- package/app/assets/script/view/default.js +0 -11
- package/app/assets/style/base/vendor/_foundation.scss +0 -2
- package/app/assets/test/spec/shareSpec.js +0 -137
- package/app/index.html +0 -43
- package/app/report/istanbul/base.css +0 -213
- package/app/report/istanbul/index.html +0 -93
- package/app/report/istanbul/prettify.css +0 -1
- package/app/report/istanbul/prettify.js +0 -1
- package/app/report/istanbul/sort-arrow-sprite.png +0 -0
- package/app/report/istanbul/sorter.js +0 -158
- package/app/report/istanbul/utility/form.js.html +0 -524
- package/app/report/istanbul/utility/index.html +0 -132
- package/app/report/istanbul/utility/regex.js.html +0 -203
- package/app/report/istanbul/utility/share.js.html +0 -401
- package/app/report/istanbul/utility/string.js.html +0 -446
- package/app/report/jsdoc/DragEvent.html +0 -303
- package/app/report/jsdoc/Event.html +0 -773
- package/app/report/jsdoc/EventPropagators.html +0 -336
- package/app/report/jsdoc/FocusEvent.html +0 -303
- package/app/report/jsdoc/ForEachBookKeeping.html +0 -425
- package/app/report/jsdoc/KeyboardEvent.html +0 -303
- package/app/report/jsdoc/MapBookKeeping.html +0 -457
- package/app/report/jsdoc/MouseEvent.html +0 -303
- package/app/report/jsdoc/ReactClass.html +0 -330
- package/app/report/jsdoc/ReactClassInterface.html +0 -311
- package/app/report/jsdoc/ReactDOMComponent.html +0 -349
- package/app/report/jsdoc/ReactDOMTextComponent.html +0 -348
- package/app/report/jsdoc/ReactMountReady.html +0 -340
- package/app/report/jsdoc/ReactMultiChild.html +0 -330
- package/app/report/jsdoc/ReactOwner.html +0 -351
- package/app/report/jsdoc/ReactReconcileTransaction.html +0 -342
- package/app/report/jsdoc/ReactServerRenderingTransaction.html +0 -376
- package/app/report/jsdoc/ReactServerUpdateQueue.html +0 -382
- package/app/report/jsdoc/TouchEvent.html +0 -303
- package/app/report/jsdoc/Transaction.html +0 -459
- package/app/report/jsdoc/UIEvent.html +0 -303
- package/app/report/jsdoc/WheelEvent.html +0 -303
- package/app/report/jsdoc/classes.list.html +0 -339
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.eot +0 -0
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.svg +0 -288
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.woff +0 -0
- package/app/report/jsdoc/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/app/report/jsdoc/global.html +0 -1653
- package/app/report/jsdoc/img/glyphicons-halflings-white.png +0 -0
- package/app/report/jsdoc/img/glyphicons-halflings.png +0 -0
- package/app/report/jsdoc/index.html +0 -236
- package/app/report/jsdoc/interfaces.list.html +0 -339
- package/app/report/jsdoc/quicksearch.html +0 -31
- package/app/report/jsdoc/scripts/docstrap.lib.js +0 -11
- package/app/report/jsdoc/scripts/fulltext-search-ui.js +0 -89
- package/app/report/jsdoc/scripts/fulltext-search.js +0 -36
- package/app/report/jsdoc/scripts/lunr.min.js +0 -6
- package/app/report/jsdoc/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/app/report/jsdoc/scripts/prettify/jquery.min.js +0 -6
- package/app/report/jsdoc/scripts/prettify/lang-css.js +0 -21
- package/app/report/jsdoc/scripts/prettify/prettify.js +0 -496
- package/app/report/jsdoc/scripts/sunlight.js +0 -1157
- package/app/report/jsdoc/scripts/toc.js +0 -203
- package/app/report/jsdoc/styles/darkstrap.css +0 -960
- package/app/report/jsdoc/styles/prettify-tomorrow.css +0 -132
- package/app/report/jsdoc/styles/site.cerulean.css +0 -7008
- package/app/report/jsdoc/styles/site.cosmo.css +0 -7061
- package/app/report/jsdoc/styles/site.cyborg.css +0 -7048
- package/app/report/jsdoc/styles/site.darkly.css +0 -7171
- package/app/report/jsdoc/styles/site.darkstrap.css +0 -5638
- package/app/report/jsdoc/styles/site.dibs-bootstrap.css +0 -5899
- package/app/report/jsdoc/styles/site.flatly.css +0 -7147
- package/app/report/jsdoc/styles/site.journal.css +0 -6973
- package/app/report/jsdoc/styles/site.lumen.css +0 -7298
- package/app/report/jsdoc/styles/site.paper.css +0 -7623
- package/app/report/jsdoc/styles/site.readable.css +0 -6997
- package/app/report/jsdoc/styles/site.sandstone.css +0 -7035
- package/app/report/jsdoc/styles/site.simplex.css +0 -7023
- package/app/report/jsdoc/styles/site.slate.css +0 -7343
- package/app/report/jsdoc/styles/site.spacelab.css +0 -7055
- package/app/report/jsdoc/styles/site.superhero.css +0 -7131
- package/app/report/jsdoc/styles/site.united.css +0 -6895
- package/app/report/jsdoc/styles/site.yeti.css +0 -7195
- package/app/report/jsdoc/styles/sunlight.dark.css +0 -345
- package/app/report/jsdoc/styles/sunlight.default.css +0 -344
- package/gulp/config.js +0 -207
- package/gulp/tasks/accessibility.js +0 -34
- package/gulp/tasks/build.js +0 -18
- package/gulp/tasks/clean.js +0 -18
- package/gulp/tasks/data.js +0 -22
- package/gulp/tasks/default.js +0 -9
- package/gulp/tasks/deploy.js +0 -222
- package/gulp/tasks/documentation.js +0 -28
- package/gulp/tasks/markup.js +0 -26
- package/gulp/tasks/script.js +0 -92
- package/gulp/tasks/style.js +0 -42
- package/gulp/tasks/unit.js +0 -38
- package/gulp/tasks/watch.js +0 -77
- package/gulpfile.js +0 -8
- package/jsdoc.json +0 -23
- package/karma.conf.js +0 -58
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/** @module app/assets/script/utility/string */
|
|
2
|
+
const parser = new DOMParser();
|
|
3
|
+
|
|
4
|
+
const integerFormatter = new Intl.NumberFormat('en-US', {
|
|
5
|
+
maximumFractionDigits: 0
|
|
6
|
+
});
|
|
7
|
+
const currencyFormatter = new Intl.NumberFormat('en-US', {
|
|
8
|
+
currency: 'USD',
|
|
9
|
+
minimumFractionDigits: 2,
|
|
10
|
+
style: 'currency'
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Format a numeric date component with at least two digits.
|
|
15
|
+
* @param number - Numeric value to inspect or format.
|
|
16
|
+
* @returns A string containing at least two digits.
|
|
17
|
+
*/
|
|
18
|
+
function pad(number: number) {
|
|
19
|
+
return String(number).padStart(2, '0');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Format a valid date using local calendar components, or return null for invalid input.
|
|
24
|
+
* @param value - Value to find or format.
|
|
25
|
+
* @returns YYYY-MM-DD in local time, or null for invalid input.
|
|
26
|
+
*/
|
|
27
|
+
function dateParts(value: string | number | Date) {
|
|
28
|
+
const date = new Date(value);
|
|
29
|
+
if (Number.isNaN(date.getTime())) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
'use strict';
|
|
36
|
+
|
|
37
|
+
export default class {
|
|
38
|
+
|
|
39
|
+
//turn a string of html tags into a dom object
|
|
40
|
+
/**
|
|
41
|
+
* Parse trusted HTML and clone its first root node; reject empty markup.
|
|
42
|
+
* @param string - Trusted HTML containing at least one root node.
|
|
43
|
+
* @returns A clone of the first parsed root node.
|
|
44
|
+
* @throws When input does not satisfy the documented contract.
|
|
45
|
+
*/
|
|
46
|
+
toElement(string: string) {
|
|
47
|
+
const element = parser.parseFromString(string, 'text/html').body.firstChild;
|
|
48
|
+
if (!element) throw new TypeError('HTML must contain a root node');
|
|
49
|
+
return element.cloneNode(true);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//qet data from url query string
|
|
53
|
+
/**
|
|
54
|
+
* Read and decode a query value, returning null when absent and an empty string when valueless.
|
|
55
|
+
* @param name - Resource, field, or parameter name.
|
|
56
|
+
* @param url - URL or optional adapter argument.
|
|
57
|
+
* @returns The decoded value, an empty string, or null when absent.
|
|
58
|
+
*/
|
|
59
|
+
getQueryStringParamater(name: string, url: string) {
|
|
60
|
+
name = name.replace(/[[\]]/g, '\\$&');
|
|
61
|
+
let regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');
|
|
62
|
+
let results = regex.exec(url);
|
|
63
|
+
if (!results) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
if (!results[2]) {
|
|
67
|
+
return '';
|
|
68
|
+
}
|
|
69
|
+
return decodeURIComponent(results[2].replace(/\+/g, ' '));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 2014-11-10
|
|
73
|
+
/**
|
|
74
|
+
* Format a local calendar date as YYYY-MM-DD or return Invalid date.
|
|
75
|
+
* @param unformattedDate - Date input to format.
|
|
76
|
+
* @returns A local YYYY-MM-DD string or Invalid date.
|
|
77
|
+
*/
|
|
78
|
+
formatDate(unformattedDate: string | number | Date) {
|
|
79
|
+
return dateParts(unformattedDate) || 'Invalid date';
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//format the api accepts back
|
|
83
|
+
/**
|
|
84
|
+
* Format a calendar date using the legacy API noon timestamp convention.
|
|
85
|
+
* @param unformattedDate - Date input to format.
|
|
86
|
+
* @returns A YYYY-MM-DDT12:00 string or Invalid date.
|
|
87
|
+
*/
|
|
88
|
+
formatDateAPI(unformattedDate: string) {
|
|
89
|
+
const formattedDate = dateParts(`${unformattedDate}T00:00:00`);
|
|
90
|
+
return formattedDate ? `${formattedDate}T12:00` : 'Invalid date';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Format a rounded number using en-US grouping.
|
|
95
|
+
* @param unformattedNumber - Numeric input to format.
|
|
96
|
+
* @returns The grouped and rounded number string.
|
|
97
|
+
*/
|
|
98
|
+
formatNumber(unformattedNumber: number | string) {
|
|
99
|
+
return integerFormatter.format(Number(unformattedNumber));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Parse a base-ten integer using the existing parseInt behavior.
|
|
104
|
+
* @param formattedNumber - Integer text to parse.
|
|
105
|
+
* @returns The parsed integer, or NaN when no integer can be read.
|
|
106
|
+
*/
|
|
107
|
+
unformatNumber(formattedNumber: string) {
|
|
108
|
+
return parseInt(formattedNumber, 10);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Format a numeric value as US dollars with two decimal places.
|
|
113
|
+
* @param unformattedCurrency - Numeric currency input.
|
|
114
|
+
* @returns The value formatted as US dollars.
|
|
115
|
+
*/
|
|
116
|
+
formatCurrency(unformattedCurrency: number | string) {
|
|
117
|
+
return currencyFormatter.format(Number(unformattedCurrency));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Remove currency decoration and return two decimal places, falling back to 0.00 for invalid input.
|
|
122
|
+
* @param formattedCurrency - Decorated currency text or number.
|
|
123
|
+
* @returns An undecorated decimal string with two places.
|
|
124
|
+
*/
|
|
125
|
+
unformatCurrency(formattedCurrency: number | string) {
|
|
126
|
+
const number = Number(String(formattedCurrency).replace(/[^0-9.-]/g, ''));
|
|
127
|
+
return Number.isFinite(number) ? number.toFixed(2) : '0.00';
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Create a telephone link using only the supplied digits.
|
|
132
|
+
* @param unformattedPhoneNumber - Phone number containing optional formatting.
|
|
133
|
+
* @returns A tel link containing only digits.
|
|
134
|
+
*/
|
|
135
|
+
formatPhoneLink(unformattedPhoneNumber: string) {
|
|
136
|
+
return 'tel:' + unformattedPhoneNumber.replace(/\D/g,'');
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Create a mailto link from the supplied email address.
|
|
141
|
+
* @param unformattedEmailAddress - Email address to place in the link.
|
|
142
|
+
* @returns A mailto link.
|
|
143
|
+
*/
|
|
144
|
+
formatEmailLink(unformattedEmailAddress: string) {
|
|
145
|
+
return 'mailto:' + unformattedEmailAddress;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @module app/assets/script/view/default */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
export default class HelloMessage extends React.Component<{name: string}> {
|
|
7
|
+
/**
|
|
8
|
+
* Render the greeting from the component name prop.
|
|
9
|
+
* @returns The greeting React element.
|
|
10
|
+
*/
|
|
11
|
+
render() {
|
|
12
|
+
return <div>Hello {this.props.name}</div>;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @module app/assets/script/view/toolkit/youtube-player-1 */
|
|
2
|
+
import View from 'white-label-view';
|
|
3
|
+
|
|
4
|
+
'use strict';
|
|
5
|
+
export default class extends View {
|
|
6
|
+
/**
|
|
7
|
+
* Create an instance with its own state and listener references.
|
|
8
|
+
*/
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.parentElement = document.querySelector('body') || undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Extension hook for initializing a concrete YouTube player implementation.
|
|
15
|
+
* @returns No value.
|
|
16
|
+
*/
|
|
17
|
+
initialize() {
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Lifecycle hook for attaching listeners owned by a subclass.
|
|
21
|
+
* @returns No value.
|
|
22
|
+
*/
|
|
23
|
+
addListeners() {
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Legacy misspelled extension hook retained for compatibility with existing sample subclasses.
|
|
27
|
+
* @returns No value.
|
|
28
|
+
*/
|
|
29
|
+
removeListners() {
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -1,23 +1,39 @@
|
|
|
1
1
|
// ## colors
|
|
2
|
-
@
|
|
2
|
+
@forward 'colors/colors';
|
|
3
3
|
|
|
4
4
|
// ## fonts
|
|
5
|
-
@
|
|
6
|
-
@
|
|
7
|
-
@
|
|
5
|
+
@forward 'type/fonts';
|
|
6
|
+
@forward 'type/text';
|
|
7
|
+
@forward 'type/headings';
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
// ## utilities
|
|
11
|
-
@
|
|
12
|
-
@
|
|
13
|
-
@
|
|
11
|
+
@forward 'utilities/accessibility';
|
|
12
|
+
@forward 'utilities/scroll';
|
|
13
|
+
@forward 'utilities/type';
|
|
14
14
|
|
|
15
15
|
// ## elements
|
|
16
|
-
@
|
|
17
|
-
@
|
|
18
|
-
@
|
|
19
|
-
@
|
|
20
|
-
@
|
|
21
|
-
@
|
|
22
|
-
@
|
|
23
|
-
@
|
|
16
|
+
@forward 'elements/anchors';
|
|
17
|
+
@forward 'elements/buttons';
|
|
18
|
+
@forward 'elements/fieldsets';
|
|
19
|
+
@forward 'elements/inputs';
|
|
20
|
+
@forward 'elements/labels';
|
|
21
|
+
@forward 'elements/landmarks';
|
|
22
|
+
@forward 'elements/legends';
|
|
23
|
+
@forward 'elements/lists';
|
|
24
|
+
@forward 'elements/pictures';
|
|
25
|
+
@forward 'elements/images';
|
|
26
|
+
@forward 'elements/tables';
|
|
27
|
+
|
|
28
|
+
// ## components
|
|
29
|
+
|
|
30
|
+
@forward 'components/modal-1';
|
|
31
|
+
@forward 'components/sticky-1';
|
|
32
|
+
@forward 'components/tabpanel-base-1';
|
|
33
|
+
@forward 'components/tabpanel-1';
|
|
34
|
+
@forward 'components/tabpanel-2';
|
|
35
|
+
@forward 'components/youtube-player-1';
|
|
36
|
+
|
|
37
|
+
// ## layouts
|
|
38
|
+
|
|
39
|
+
@forward 'layouts/staggered-1';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
@use "../colors/colors";
|
|
2
|
+
@use '../utilities/functions' as *;
|
|
3
|
+
@use '../type/text' as *;
|
|
4
|
+
@use '../utilities/accessibility' as *;
|
|
5
|
+
|
|
6
|
+
// ## modals
|
|
7
|
+
|
|
8
|
+
%modal-1 {
|
|
9
|
+
|
|
10
|
+
@extend %text-1;
|
|
11
|
+
|
|
12
|
+
bottom: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
position: absolute;
|
|
15
|
+
right: 0;
|
|
16
|
+
top: 0;
|
|
17
|
+
z-index: 2;
|
|
18
|
+
|
|
19
|
+
@media screen {
|
|
20
|
+
height: 100vh;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
> .modal-1-content {
|
|
24
|
+
|
|
25
|
+
background-color: colors.$white-1;
|
|
26
|
+
height: 100%;
|
|
27
|
+
margin: 0 auto;
|
|
28
|
+
position: absolute;
|
|
29
|
+
width: 100%;
|
|
30
|
+
z-index: 3;
|
|
31
|
+
|
|
32
|
+
@include breakpoint(medium up) {
|
|
33
|
+
background-color: transparent;
|
|
34
|
+
height: auto;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
> * {
|
|
38
|
+
background-color: colors.$white-1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
> button {
|
|
44
|
+
|
|
45
|
+
@extend %accessibility-hidden-text-1;
|
|
46
|
+
|
|
47
|
+
background-color: colors.$grey-1;
|
|
48
|
+
display: block;
|
|
49
|
+
height: 100%;
|
|
50
|
+
left: 0;
|
|
51
|
+
opacity: .9;
|
|
52
|
+
position: fixed;
|
|
53
|
+
top: 0;
|
|
54
|
+
width: 100%;
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
//added to body class to control page content
|
|
61
|
+
%modal-1-open {
|
|
62
|
+
|
|
63
|
+
@include breakpoint(small only) {
|
|
64
|
+
|
|
65
|
+
.wrapper {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.modal-1 {
|
|
70
|
+
top: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@include breakpoint(medium up) {
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
@use "../colors/colors";
|
|
2
|
+
@use '../utilities/functions' as *;
|
|
3
|
+
@use 'tabpanel-base-1' as *;
|
|
4
|
+
@use '../type/text' as *;
|
|
5
|
+
|
|
6
|
+
// ## tabpanel-1
|
|
7
|
+
|
|
8
|
+
%tabpanel-1 {
|
|
9
|
+
|
|
10
|
+
@extend %tabpanel-base-1;
|
|
11
|
+
@extend %text-1;
|
|
12
|
+
|
|
13
|
+
margin: 0;
|
|
14
|
+
|
|
15
|
+
> [role='tablist'] {
|
|
16
|
+
|
|
17
|
+
@include clearfix;
|
|
18
|
+
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
|
|
22
|
+
> [role='tab'] {
|
|
23
|
+
|
|
24
|
+
@extend %text-1;
|
|
25
|
+
|
|
26
|
+
background-color: colors.$white-1;
|
|
27
|
+
border-bottom: rem-calc(1) solid colors.$white-1;
|
|
28
|
+
border-left: rem-calc(1) solid colors.$black-1;
|
|
29
|
+
border-right: rem-calc(1) solid colors.$black-1;
|
|
30
|
+
border-top: rem-calc(1) solid colors.$black-1;
|
|
31
|
+
color: colors.$black-1;
|
|
32
|
+
display: block;
|
|
33
|
+
float: left;
|
|
34
|
+
list-style: none;
|
|
35
|
+
margin: 0 rem-calc(1) 0 0;
|
|
36
|
+
padding: rem-calc(13.5);
|
|
37
|
+
text-decoration: none;
|
|
38
|
+
|
|
39
|
+
&[aria-selected='false'] {
|
|
40
|
+
background-color: colors.$black-1;
|
|
41
|
+
border-bottom-color: colors.$black-1;
|
|
42
|
+
color: colors.$white-1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
> [role='tabpanel'] {
|
|
50
|
+
border: rem-calc(1) solid colors.$black-1;
|
|
51
|
+
margin-top: rem-calc(-1);
|
|
52
|
+
padding: rem-calc(10);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// ### tabpanel-2
|
|
58
|
+
|
|
59
|
+
%tabpanel-2 {
|
|
60
|
+
|
|
61
|
+
@extend %tabpanel-base-1;
|
|
62
|
+
@extend %text-1;
|
|
63
|
+
|
|
64
|
+
margin: 0;
|
|
65
|
+
|
|
66
|
+
[role='tablist'] {
|
|
67
|
+
|
|
68
|
+
@include clearfix;
|
|
69
|
+
|
|
70
|
+
border: rem-calc(1) solid colors.$black-1;
|
|
71
|
+
margin: 0;
|
|
72
|
+
padding: 0;
|
|
73
|
+
|
|
74
|
+
> [role='tab'] {
|
|
75
|
+
|
|
76
|
+
@extend %text-1;
|
|
77
|
+
|
|
78
|
+
background-color: colors.$grey-5;
|
|
79
|
+
border-bottom: rem-calc(1) solid colors.$black-1;
|
|
80
|
+
color: colors.$black-1;
|
|
81
|
+
display: block;
|
|
82
|
+
list-style: none;
|
|
83
|
+
margin: 0 rem-calc(1) 0 0;
|
|
84
|
+
padding: rem-calc(13.5);
|
|
85
|
+
text-decoration: none;
|
|
86
|
+
width: 100%;
|
|
87
|
+
|
|
88
|
+
&[aria-selected='false'] {
|
|
89
|
+
background-color: colors.$black-1;
|
|
90
|
+
border: 0;
|
|
91
|
+
color: colors.$white-1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
> [role='tabpanel'] {
|
|
97
|
+
|
|
98
|
+
max-height: 0;
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
transition: max-height .3s ease;
|
|
101
|
+
|
|
102
|
+
&[aria-hidden='false'] {
|
|
103
|
+
max-height: rem-calc(1000);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
> * {
|
|
107
|
+
margin-left: rem-calc(10);
|
|
108
|
+
margin-right: rem-calc(10);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
@use "../colors/colors";
|
|
2
|
+
@use '../utilities/functions' as *;
|
|
3
|
+
@use 'tabpanel-base-1' as *;
|
|
4
|
+
@use '../type/text' as *;
|
|
5
|
+
|
|
6
|
+
// ## tabpanel-2
|
|
7
|
+
|
|
8
|
+
%tabpanel-2 {
|
|
9
|
+
|
|
10
|
+
@extend %tabpanel-base-1;
|
|
11
|
+
@extend %text-1;
|
|
12
|
+
|
|
13
|
+
margin: 0;
|
|
14
|
+
|
|
15
|
+
[role='tablist'] {
|
|
16
|
+
|
|
17
|
+
@include clearfix;
|
|
18
|
+
|
|
19
|
+
border: rem-calc(1) solid colors.$black-1;
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 0;
|
|
22
|
+
|
|
23
|
+
> [role='tab'] {
|
|
24
|
+
|
|
25
|
+
@extend %text-1;
|
|
26
|
+
|
|
27
|
+
background-color: colors.$grey-5;
|
|
28
|
+
border-bottom: rem-calc(1) solid colors.$black-1;
|
|
29
|
+
color: colors.$black-1;
|
|
30
|
+
display: block;
|
|
31
|
+
list-style: none;
|
|
32
|
+
margin: 0 rem-calc(1) 0 0;
|
|
33
|
+
padding: rem-calc(13.5);
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
width: 100%;
|
|
36
|
+
|
|
37
|
+
&[aria-selected='false'] {
|
|
38
|
+
background-color: colors.$black-1;
|
|
39
|
+
border: 0;
|
|
40
|
+
color: colors.$white-1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
> [role='tabpanel'] {
|
|
46
|
+
|
|
47
|
+
max-height: 0;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
transition: max-height .3s ease;
|
|
50
|
+
|
|
51
|
+
&[aria-hidden='false'] {
|
|
52
|
+
max-height: rem-calc(1000);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
> * {
|
|
56
|
+
margin-left: rem-calc(10);
|
|
57
|
+
margin-right: rem-calc(10);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@use '../utilities/functions' as *;
|
|
2
|
+
|
|
3
|
+
// ### youtube-video-1
|
|
4
|
+
|
|
5
|
+
%youtube-player-1 {
|
|
6
|
+
|
|
7
|
+
// Keep embedded videos responsive without depending on framework Sass mixins.
|
|
8
|
+
@include responsive-embed;
|
|
9
|
+
|
|
10
|
+
margin: 0;
|
|
11
|
+
|
|
12
|
+
&.widescreen {
|
|
13
|
+
padding-bottom: $responsive-embed-margin-bottom;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
@use "../colors/colors";
|
|
2
|
+
@use '../utilities/functions' as *;
|
|
3
|
+
@use '../type/text' as *;
|
|
4
|
+
|
|
1
5
|
%button-base-1 {
|
|
2
6
|
|
|
3
7
|
@extend %text-1;
|
|
@@ -8,3 +12,14 @@
|
|
|
8
12
|
padding: 0;
|
|
9
13
|
|
|
10
14
|
}
|
|
15
|
+
|
|
16
|
+
%button-1 {
|
|
17
|
+
|
|
18
|
+
@extend %button-base-1;
|
|
19
|
+
|
|
20
|
+
background-color: colors.$black-1;
|
|
21
|
+
border: rem-calc(1) solid colors.$black-1;
|
|
22
|
+
color: colors.$white-1;
|
|
23
|
+
padding: 0 rem-calc(13.5);
|
|
24
|
+
|
|
25
|
+
}
|