Commit 2682f572 by Иван Кубота

Format component.

Fix bug with DOM children hooked update.
parent e4732f08
...@@ -248,8 +248,8 @@ NS.apply = function(a,b) { ...@@ -248,8 +248,8 @@ NS.apply = function(a,b) {
if( type !== 'object' ){ if( type !== 'object' ){
// TODO : add hook // TODO : add hook
if( type === 'function' ){ if( type === 'function' ){
//var tmp = D.Text();//( {cls: 'zero-wrapper'} ); var tmp = D.Text('');//( {cls: 'zero-wrapper'} );
//el.appendChild( tmp ); el.appendChild( tmp );
var list = []; var list = [];
subEl( function(){ subEl( function(){
...@@ -259,7 +259,7 @@ NS.apply = function(a,b) { ...@@ -259,7 +259,7 @@ NS.apply = function(a,b) {
var fragment = document.createDocumentFragment(); var fragment = document.createDocumentFragment();
D.appendChild( fragment, [].slice.call( arguments ) ); D.appendChild( fragment, [].slice.call( arguments ) );
list = [].slice.call(fragment.childNodes); list = [].slice.call(fragment.childNodes);
el.appendChild(fragment); el.insertBefore(fragment, tmp);
} ) } )
}else if( subEl !== void 0 && subEl !== false && subEl !== null ){ }else if( subEl !== void 0 && subEl !== false && subEl !== null ){
el.appendChild( D.Text( subEl ) ); el.appendChild( D.Text( subEl ) );
......
var textCache = {}; var textCache = {};
String.Typography = function(text, cfg) { String.Typography = function(text, cfg) {
const {html} = cfg; const {html} = cfg || {};
if(typeof text !== 'string') if(typeof text !== 'string')
return text; return text;
...@@ -168,4 +168,5 @@ String.Search = function(string, search) { ...@@ -168,4 +168,5 @@ String.Search = function(string, search) {
} }
return yep; return yep;
}; };
\ No newline at end of file export const Typography = String.Typography;
\ No newline at end of file
...@@ -19,12 +19,15 @@ export default D.declare('view.block.Header', () => { ...@@ -19,12 +19,15 @@ export default D.declare('view.block.Header', () => {
</button> </button>
<div cls={D.cls({'hidden': tempPageMenuHidden})}>{ <div cls={D.cls({'hidden': tempPageMenuHidden})}>{
Object.keys(Page).map(name=> Object.keys(Page)
<button class="temp-button" type={'button'} onClick={() => store.set('navigation.current', name)}>{name}</button> .map( name =>
) <button class="temp-button" type={'button'} onClick={() => store.set('navigation.current', name)}>
{name}
</button>
)
}</div> }</div>
</div> </div>
<IF condition={NOT(store.valEqual( 'navigation.current', 'login'))}> <IF condition={NOT(store.valEqual( 'navigation.current', 'Login'))}>
<div className="page-header__wrapper"> <div className="page-header__wrapper">
<a href="#" class="page-header__logo" aria-label={"Логотип ВкусВилл"}> <a href="#" class="page-header__logo" aria-label={"Логотип ВкусВилл"}>
<Logo width="116" height="41"/> <Logo width="116" height="41"/>
......
import { Typography } from "../../../text/String.Typography";
const Format = D.declare( 'view.cmp.Format', (cfg, children) => {
const html = Typography(children.join(' '), {html: cfg.html});
const div = <div/>
div.innerHTML = html;
return <>
{[...div.childNodes]}
</>
} );
export default Format;
export { Format };
\ No newline at end of file
import './accountPage.scss'; import './accountPage.scss';
import User from "/svg/user.svg"; import User from "/svg/user.svg";
import Rating from '../../block/ratingBlock/Rating.jsx'; import Rating from '../../block/ratingBlock/Rating.jsx';
import Format from "../../cmp/format/Format";
const Account = D.declare('view.page.Account', () => { const Account = D.declare('view.page.Account', () => {
return <div class="account-page"> return <div class="account-page">
...@@ -26,48 +27,50 @@ const Account = D.declare('view.page.Account', () => { ...@@ -26,48 +27,50 @@ const Account = D.declare('view.page.Account', () => {
</div> </div>
<div class="account-page__content"> <div class="account-page__content">
<div class="account-page__content-inner"> <div class="account-page__content-inner">
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. <Format html={true}>
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
Where can I get some? Where can I get some?
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc. There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
5 5
paragraphs paragraphs
words words
bytes bytes
lists lists
Start with 'Lorem Start with 'Lorem
ipsum dolor sit amet...' ipsum dolor sit amet...'
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
Where can I get some? Where can I get some?
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc. There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
5 5
paragraphs paragraphs
words words
bytes bytes
lists lists
Start with 'Lorem Start with 'Lorem
ipsum dolor sit amet...' ipsum dolor sit amet...'
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.
Where can I get some? Where can I get some?
There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc. There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
5 5
paragraphs paragraphs
words words
bytes bytes
lists lists
Start with 'Lorem Start with 'Lorem
ipsum dolor sit amet...' ipsum dolor sit amet...'
</Format>
</div> </div>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment