Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix c method #46

Merged
merged 1 commit into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/clapton/javascripts/dist/c-for-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ var c = (function () {
}
get renderWrapper() {
let value = this.state[this.attribute];
if (!this.attributes.type) {
this.attributes.type = "text";
}
if (this.attributes.type === "datetime-local" && value) {
value = this.datetime_local_value(value);
}
Expand Down Expand Up @@ -383,6 +386,10 @@ var c = (function () {
};
const c = (name, ...props) => {
switch (name) {
case "bq":
return blockquote(...props);
case "box":
return div(...props);
case "blockquote":
return blockquote(...props);
case "div":
Expand All @@ -401,6 +408,8 @@ var c = (function () {
return em(...props);
case "form":
return form(...props);
case "h":
return h1(...props);
case "h1":
return h1(...props);
case "h2":
Expand Down Expand Up @@ -437,6 +446,15 @@ var c = (function () {
return input(...props);
case "text":
return text(...props);
case "radio":
props[3].type = "radio";
return input(...props);
case "datetime":
props[3].type = "datetime-local";
return input(...props);
case "check":
props[3].type = "checkbox";
return input(...props);
default:
return new Clapton.Element(name, ...props);
}
Expand Down
18 changes: 18 additions & 0 deletions lib/clapton/javascripts/dist/c.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ class Input extends Base {
}
get renderWrapper() {
let value = this.state[this.attribute];
if (!this.attributes.type) {
this.attributes.type = "text";
}
if (this.attributes.type === "datetime-local" && value) {
value = this.datetime_local_value(value);
}
Expand Down Expand Up @@ -380,6 +383,10 @@ const text = (...props) => {
};
const c = (name, ...props) => {
switch (name) {
case "bq":
return blockquote(...props);
case "box":
return div(...props);
case "blockquote":
return blockquote(...props);
case "div":
Expand All @@ -398,6 +405,8 @@ const c = (name, ...props) => {
return em(...props);
case "form":
return form(...props);
case "h":
return h1(...props);
case "h1":
return h1(...props);
case "h2":
Expand Down Expand Up @@ -434,6 +443,15 @@ const c = (name, ...props) => {
return input(...props);
case "text":
return text(...props);
case "radio":
props[3].type = "radio";
return input(...props);
case "datetime":
props[3].type = "datetime-local";
return input(...props);
case "check":
props[3].type = "checkbox";
return input(...props);
default:
return new Clapton.Element(name, ...props);
}
Expand Down
3 changes: 3 additions & 0 deletions lib/clapton/javascripts/dist/components-for-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ var Clapton = (function (exports) {
}
get renderWrapper() {
let value = this.state[this.attribute];
if (!this.attributes.type) {
this.attributes.type = "text";
}
if (this.attributes.type === "datetime-local" && value) {
value = this.datetime_local_value(value);
}
Expand Down
3 changes: 3 additions & 0 deletions lib/clapton/javascripts/dist/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ class Input extends Base {
}
get renderWrapper() {
let value = this.state[this.attribute];
if (!this.attributes.type) {
this.attributes.type = "text";
}
if (this.attributes.type === "datetime-local" && value) {
value = this.datetime_local_value(value);
}
Expand Down
15 changes: 15 additions & 0 deletions lib/clapton/javascripts/src/c-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ const text = (...props: any[]) => {

const c = (name: string, ...props: any[]) => {
switch (name) {
case "bq":
return blockquote(...props)
case "box":
return div(...props)
case "blockquote":
return blockquote(...props)
case "div":
Expand All @@ -128,6 +132,8 @@ const c = (name: string, ...props: any[]) => {
return em(...props)
case "form":
return form(...props)
case "h":
return h1(...props)
case "h1":
return h1(...props)
case "h2":
Expand Down Expand Up @@ -164,6 +170,15 @@ const c = (name: string, ...props: any[]) => {
return input(...props)
case "text":
return text(...props)
case "radio":
props[3].type = "radio"
return input(...props)
case "datetime":
props[3].type = "datetime-local"
return input(...props)
case "check":
props[3].type = "checkbox"
return input(...props)
default:
return new Clapton.Element(name, ...props)
}
Expand Down
3 changes: 3 additions & 0 deletions lib/clapton/javascripts/src/components/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export class Input extends Base {

get renderWrapper(): string {
let value = this.state[this.attribute]
if (!this.attributes.type) {
this.attributes.type = "text"
}
if (this.attributes.type === "datetime-local" && value) {
value = this.datetime_local_value(value)
}
Expand Down
Loading