smoothly 0.1.87 → 0.1.91
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/dist/cjs/GoogleFont-6c4f0da1.js +21 -0
- package/dist/cjs/{index-de5d1ee1.js → index-40d009d5.js} +2 -0
- package/dist/cjs/{index-328edd81.js → index-bc3845e8.js} +253 -182
- package/dist/cjs/index.cjs.js +8 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/smoothly-accordion_47.cjs.entry.js +296 -201
- package/dist/cjs/smoothly-calendar.cjs.entry.js +38 -10
- package/dist/cjs/smoothly-dialog.cjs.entry.js +2 -1
- package/dist/cjs/smoothly-display-demo.cjs.entry.js +2 -1
- package/dist/cjs/smoothly-display.cjs.entry.js +1 -1
- package/dist/cjs/smoothly-frame.cjs.entry.js +2 -1
- package/dist/cjs/smoothly-google-font.cjs.entry.js +17 -0
- package/dist/cjs/smoothly-input-date-range.cjs.entry.js +8 -9
- package/dist/cjs/smoothly-input-date.cjs.entry.js +4 -0
- package/dist/cjs/smoothly-input.cjs.entry.js +4 -4
- package/dist/cjs/smoothly-select-demo.cjs.entry.js +1 -0
- package/dist/cjs/smoothly-trigger-sink.cjs.entry.js +2 -1
- package/dist/cjs/smoothly-trigger-source.cjs.entry.js +2 -1
- package/dist/cjs/smoothly.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/calendar/index.js +80 -11
- package/dist/collection/components/google-font/index.js +33 -0
- package/dist/collection/components/input/index.js +3 -3
- package/dist/collection/components/input/style.css +1 -0
- package/dist/collection/components/input-date/index.js +12 -1
- package/dist/collection/components/input-date-range/index.js +14 -15
- package/dist/collection/components/select-demo/index.js +1 -0
- package/dist/collection/index.js +1 -1
- package/dist/collection/model/GoogleFont.js +19 -0
- package/dist/collection/model/index.js +1 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +349 -214
- package/dist/esm/GoogleFont-8474516b.js +21 -0
- package/dist/esm/{index-1be6d668.js → index-37a67c97.js} +253 -182
- package/dist/{smoothly/index-68492ed9.js → esm/index-c8b5d468.js} +2 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/smoothly-accordion_47.entry.js +296 -201
- package/dist/esm/smoothly-calendar.entry.js +38 -10
- package/dist/esm/smoothly-dialog.entry.js +2 -1
- package/dist/esm/smoothly-display-demo.entry.js +2 -1
- package/dist/esm/smoothly-display.entry.js +1 -1
- package/dist/esm/smoothly-frame.entry.js +2 -1
- package/dist/esm/smoothly-google-font.entry.js +13 -0
- package/dist/esm/smoothly-input-date-range.entry.js +8 -9
- package/dist/esm/smoothly-input-date.entry.js +4 -0
- package/dist/esm/smoothly-input.entry.js +4 -4
- package/dist/esm/smoothly-select-demo.entry.js +1 -0
- package/dist/esm/smoothly-trigger-sink.entry.js +2 -1
- package/dist/esm/smoothly-trigger-source.entry.js +2 -1
- package/dist/esm/smoothly.js +1 -1
- package/dist/smoothly/GoogleFont-8474516b.js +21 -0
- package/dist/smoothly/{index-1be6d668.js → index-37a67c97.js} +253 -182
- package/dist/{esm/index-68492ed9.js → smoothly/index-c8b5d468.js} +2 -0
- package/dist/smoothly/index.esm.js +2 -1
- package/dist/smoothly/p-14232157.entry.js +1 -0
- package/dist/smoothly/p-22d4d5a7.entry.js +1 -0
- package/dist/smoothly/p-9947e4bf.entry.js +1 -0
- package/dist/smoothly/p-b8a3e273.entry.js +1 -0
- package/dist/smoothly/p-bd478a53.js +1 -0
- package/dist/smoothly/smoothly-calendar.entry.js +38 -10
- package/dist/smoothly/smoothly-dialog.entry.js +2 -1
- package/dist/smoothly/smoothly-display-demo.entry.js +2 -1
- package/dist/smoothly/smoothly-display.entry.js +1 -1
- package/dist/smoothly/smoothly-frame.entry.js +2 -1
- package/dist/smoothly/smoothly-google-font.entry.js +13 -0
- package/dist/smoothly/smoothly-input-date-range.entry.js +8 -9
- package/dist/smoothly/smoothly-input-date.entry.js +4 -0
- package/dist/smoothly/smoothly-input.entry.js +4 -4
- package/dist/smoothly/smoothly-select-demo.entry.js +1 -0
- package/dist/smoothly/smoothly-trigger-sink.entry.js +2 -1
- package/dist/smoothly/smoothly-trigger-source.entry.js +2 -1
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/dist/types/components/calendar/index.d.ts +6 -1
- package/dist/types/components/google-font/index.d.ts +5 -0
- package/dist/types/components/input-date/index.d.ts +1 -0
- package/dist/types/components/input-date-range/index.d.ts +2 -2
- package/dist/types/components.d.ts +19 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/model/GoogleFont.d.ts +6 -0
- package/dist/types/model/index.d.ts +1 -0
- package/package.json +2 -2
- package/dist/smoothly/p-09d633f8.entry.js +0 -1
- package/dist/smoothly/p-1a81597b.entry.js +0 -1
- package/dist/smoothly/p-7b43df84.entry.js +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h, a as getElement, c as createEvent, H as Host } from './index-dcb2b612.js';
|
|
2
2
|
import { A as App, N as Notice } from './Notice-d87d90f7.js';
|
|
3
3
|
import { T as Trigger, M as Message } from './Trigger-d7b181ec.js';
|
|
4
|
+
import './GoogleFont-8474516b.js';
|
|
4
5
|
|
|
5
6
|
const styleCss$D = "smoothly-accordion-item.sc-smoothly-accordion{border:1px solid rgb(var(--smoothly-dark-color));border-bottom:none}smoothly-accordion-item.sc-smoothly-accordion:first-of-type{border-top-left-radius:4px;border-top-right-radius:4px;margin-top:0.4em}smoothly-accordion-item.sc-smoothly-accordion:last-of-type{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:1px solid rgb(var(--smoothly-dark-color));margin-bottom:0.6em}smoothly-accordion-item[open].sc-smoothly-accordion{border-color:rgb(var(--smoothly-primary-color));border-bottom:1px solid rgb(var(--smoothly-primary-color))}smoothly-accordion-item[open].sc-smoothly-accordion+smoothly-accordion-item.sc-smoothly-accordion{border-top:none}";
|
|
6
7
|
|
|
@@ -18831,6 +18832,8 @@ let Calendar = class {
|
|
|
18831
18832
|
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
18832
18833
|
this.startChanged = createEvent(this, "startChanged", 7);
|
|
18833
18834
|
this.endChanged = createEvent(this, "endChanged", 7);
|
|
18835
|
+
this.dateSet = createEvent(this, "dateSet", 7);
|
|
18836
|
+
this.dateRangeSet = createEvent(this, "dateRangeSet", 7);
|
|
18834
18837
|
this.value = dist$3.Date.now();
|
|
18835
18838
|
this.clickCounter = 0;
|
|
18836
18839
|
}
|
|
@@ -18843,13 +18846,33 @@ let Calendar = class {
|
|
|
18843
18846
|
onClick(date) {
|
|
18844
18847
|
this.valueChanged.emit((this.value = date));
|
|
18845
18848
|
this.clickCounter += 1;
|
|
18846
|
-
if (this.
|
|
18847
|
-
this.
|
|
18848
|
-
|
|
18849
|
-
|
|
18850
|
-
this.
|
|
18851
|
-
|
|
18849
|
+
if (this.doubleInput) {
|
|
18850
|
+
if (this.clickCounter % 2 == 1)
|
|
18851
|
+
this.start = this.end = this.frozenDate = date;
|
|
18852
|
+
else {
|
|
18853
|
+
if (this.start && date > this.start)
|
|
18854
|
+
this.end = date;
|
|
18855
|
+
else
|
|
18856
|
+
this.start = date;
|
|
18857
|
+
}
|
|
18858
|
+
}
|
|
18859
|
+
!this.doubleInput && this.dateSet.emit(this.value);
|
|
18860
|
+
this.doubleInput &&
|
|
18861
|
+
this.clickCounter % 2 == 0 &&
|
|
18862
|
+
this.start &&
|
|
18863
|
+
this.end &&
|
|
18864
|
+
this.dateRangeSet.emit({ start: this.start, end: this.end });
|
|
18865
|
+
}
|
|
18866
|
+
onHover(date) {
|
|
18867
|
+
if (this.doubleInput && this.clickCounter % 2 == 1) {
|
|
18868
|
+
if (date < this.frozenDate) {
|
|
18852
18869
|
this.start = date;
|
|
18870
|
+
this.end = this.frozenDate;
|
|
18871
|
+
}
|
|
18872
|
+
else {
|
|
18873
|
+
this.start = this.frozenDate;
|
|
18874
|
+
this.end = date;
|
|
18875
|
+
}
|
|
18853
18876
|
}
|
|
18854
18877
|
}
|
|
18855
18878
|
render() {
|
|
@@ -18861,11 +18884,17 @@ let Calendar = class {
|
|
|
18861
18884
|
} }),
|
|
18862
18885
|
h("table", null, h("thead", null, h("tr", null, weekdays().map(day => (h("th", null, day))))), month((_b = this.month) !== null && _b !== void 0 ? _b : this.value).map(week => (h("tr", null, week.map(date => {
|
|
18863
18886
|
var _a, _b, _c;
|
|
18864
|
-
return (h("td", { tabindex: 1,
|
|
18887
|
+
return (h("td", { tabindex: 1, onMouseOver: () => {
|
|
18888
|
+
!this.doubleInput && (this.min || this.max) && (date < this.min || date > this.max)
|
|
18889
|
+
? undefined
|
|
18890
|
+
: this.onHover(date);
|
|
18891
|
+
}, onClick: (this.min || this.max) && (date < this.min || date > this.max) ? undefined : () => this.onClick(date), class: (date == this.value ? ["selected"] : [])
|
|
18865
18892
|
.concat(...(date == dist$3.Date.now() ? ["today"] : []), dist$3.Date.firstOfMonth((_a = this.month) !== null && _a !== void 0 ? _a : this.value) == dist$3.Date.firstOfMonth(date) ? ["currentMonth"] : [], this.doubleInput
|
|
18866
|
-
?
|
|
18867
|
-
? ["
|
|
18868
|
-
:
|
|
18893
|
+
? this.start == date || this.end == date
|
|
18894
|
+
? ["selected"]
|
|
18895
|
+
: date >= ((_b = this.start) !== null && _b !== void 0 ? _b : "") && date <= ((_c = this.end) !== null && _c !== void 0 ? _c : "")
|
|
18896
|
+
? ["dateRange"]
|
|
18897
|
+
: []
|
|
18869
18898
|
: "")
|
|
18870
18899
|
.concat(...(this.min || this.max ? (date < this.min || date > this.max ? ["disable"] : []) : ""))
|
|
18871
18900
|
.join(" ") }, date.substring(8, 10)));
|
|
@@ -37833,17 +37862,31 @@ exports.DateFormat = void 0;
|
|
|
37833
37862
|
function fromLocale(locale) {
|
|
37834
37863
|
let result;
|
|
37835
37864
|
switch (locale) {
|
|
37865
|
+
case "sq-AL":
|
|
37866
|
+
case "es-AR":
|
|
37867
|
+
case "it-IT":
|
|
37836
37868
|
case "en-GB":
|
|
37869
|
+
case "fr-FR":
|
|
37837
37870
|
result = "dd/mm/YYYY";
|
|
37838
37871
|
break;
|
|
37839
37872
|
case "en-US":
|
|
37840
37873
|
result = "mm/dd/YYYY";
|
|
37841
37874
|
break;
|
|
37875
|
+
case "et-EE":
|
|
37876
|
+
case "de-AT":
|
|
37842
37877
|
case "de-DE":
|
|
37878
|
+
case "he-IL":
|
|
37879
|
+
case "is-IS":
|
|
37880
|
+
case "lv-LV":
|
|
37843
37881
|
case "pl-PL":
|
|
37844
37882
|
case "ru-RU":
|
|
37883
|
+
case "fi-FI":
|
|
37845
37884
|
result = "dd.mm.YYYY";
|
|
37846
37885
|
break;
|
|
37886
|
+
case "hi-IN":
|
|
37887
|
+
case "en-IN":
|
|
37888
|
+
result = "dd-mm-YYYY";
|
|
37889
|
+
break;
|
|
37847
37890
|
default:
|
|
37848
37891
|
result = "YYYY-mm-dd";
|
|
37849
37892
|
break;
|
|
@@ -37879,146 +37922,254 @@ exports.DateFormat = void 0;
|
|
|
37879
37922
|
//# sourceMappingURL=DateFormat.js.map
|
|
37880
37923
|
});
|
|
37881
37924
|
|
|
37882
|
-
var
|
|
37925
|
+
var Base_1 = createCommonjsModule(function (module, exports) {
|
|
37883
37926
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37884
|
-
exports.
|
|
37885
|
-
|
|
37886
|
-
|
|
37887
|
-
|
|
37888
|
-
|
|
37889
|
-
|
|
37890
|
-
|
|
37891
|
-
state.value.substring(startIndex, startIndex + 1) == "1")
|
|
37892
|
-
result = symbol <= "9" && symbol >= "0";
|
|
37893
|
-
else if (state.value.substring(startIndex, startIndex + 1) == "0")
|
|
37894
|
-
result = symbol <= "9" && symbol >= "1";
|
|
37895
|
-
else
|
|
37896
|
-
result = symbol == "1" || symbol == "0";
|
|
37927
|
+
exports.register = exports.Base = void 0;
|
|
37928
|
+
|
|
37929
|
+
|
|
37930
|
+
|
|
37931
|
+
class Base {
|
|
37932
|
+
constructor(seperator) {
|
|
37933
|
+
this.seperator = seperator;
|
|
37897
37934
|
}
|
|
37898
|
-
|
|
37899
|
-
|
|
37900
|
-
|
|
37901
|
-
|
|
37902
|
-
|
|
37903
|
-
|
|
37904
|
-
|
|
37905
|
-
|
|
37906
|
-
|
|
37907
|
-
|
|
37908
|
-
|
|
37909
|
-
result = symbol < "3" && symbol >= "0";
|
|
37935
|
+
unformat(formated) {
|
|
37936
|
+
return formated.delete(this.seperator);
|
|
37937
|
+
}
|
|
37938
|
+
daysInMonth(value) {
|
|
37939
|
+
var _a;
|
|
37940
|
+
return (32 -
|
|
37941
|
+
Number.parseInt(dist$3.Date.next(((_a = this.fromString(value.padEnd(8, "1"))) !== null && _a !== void 0 ? _a : "1970-01-01").substring(0, 8) + "28", 4).substring(8, 10)));
|
|
37942
|
+
}
|
|
37943
|
+
validMonth(day, month, year) {
|
|
37944
|
+
return (new Date(Number.parseInt(year !== null && year !== void 0 ? year : "2004"), Number.parseInt(month), 0).getDate() >=
|
|
37945
|
+
Number.parseInt(day));
|
|
37910
37946
|
}
|
|
37911
|
-
return result;
|
|
37912
|
-
}
|
|
37913
|
-
exports.validMonth = validMonth;
|
|
37914
|
-
function validYear(symbol, state, startIndex, endIndex) {
|
|
37915
|
-
return state.value.length < endIndex && state.value.length >= startIndex && symbol >= "0" && symbol <= "9";
|
|
37916
37947
|
}
|
|
37917
|
-
exports.
|
|
37918
|
-
|
|
37919
|
-
|
|
37948
|
+
exports.Base = Base;
|
|
37949
|
+
const handlers = {};
|
|
37950
|
+
function register(format, create) {
|
|
37951
|
+
handlers[format] = create;
|
|
37920
37952
|
}
|
|
37921
|
-
exports.
|
|
37922
|
-
|
|
37923
|
-
|
|
37924
|
-
|
|
37925
|
-
|
|
37926
|
-
|
|
37927
|
-
|
|
37928
|
-
|
|
37929
|
-
|
|
37930
|
-
|
|
37931
|
-
|
|
37932
|
-
|
|
37933
|
-
|
|
37934
|
-
|
|
37935
|
-
|
|
37936
|
-
|
|
37937
|
-
|
|
37938
|
-
|
|
37939
|
-
|
|
37940
|
-
|
|
37941
|
-
|
|
37942
|
-
|
|
37943
|
-
|
|
37944
|
-
|
|
37945
|
-
|
|
37946
|
-
|
|
37947
|
-
|
|
37948
|
-
|
|
37949
|
-
|
|
37950
|
-
|
|
37951
|
-
|
|
37952
|
-
|
|
37953
|
+
exports.register = register;
|
|
37954
|
+
base.add("date", (parameters) => {
|
|
37955
|
+
var _a;
|
|
37956
|
+
const argument = parameters && parameters.length > 0 ? parameters[0] : undefined;
|
|
37957
|
+
const format = DateFormat_1.DateFormat.is(argument) ? argument : DateFormat_1.DateFormat.fromLocale(argument);
|
|
37958
|
+
const create = (_a = handlers[format]) !== null && _a !== void 0 ? _a : handlers["YYYY-mm-dd"];
|
|
37959
|
+
return create();
|
|
37960
|
+
});
|
|
37961
|
+
//# sourceMappingURL=Base.js.map
|
|
37962
|
+
});
|
|
37963
|
+
|
|
37964
|
+
createCommonjsModule(function (module, exports) {
|
|
37965
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37966
|
+
|
|
37967
|
+
|
|
37968
|
+
class Handler extends Base_1.Base {
|
|
37969
|
+
constructor(seperator) {
|
|
37970
|
+
super(seperator);
|
|
37971
|
+
}
|
|
37972
|
+
toString(data) {
|
|
37973
|
+
return data.length == 10
|
|
37974
|
+
? [data.substring(8, 10), data.substring(5, 7), data.substring(0, 4)].join(this.seperator)
|
|
37975
|
+
: "";
|
|
37976
|
+
}
|
|
37977
|
+
fromString(value) {
|
|
37978
|
+
const result = value.length == 8 ? `${value.substring(4, 8)}-${value.substring(2, 4)}-${value.substring(0, 2)}` : undefined;
|
|
37979
|
+
return dist$3.Date.is(result) ? result : undefined;
|
|
37980
|
+
}
|
|
37981
|
+
format(unformatted) {
|
|
37982
|
+
let result = unformatted;
|
|
37983
|
+
if (result.get(0, 1) > "3")
|
|
37984
|
+
result = result.insert(0, "0");
|
|
37985
|
+
if (result.value.length > 1)
|
|
37986
|
+
result = result.insert(2, this.seperator);
|
|
37987
|
+
if (result.get(3, 1) > "1")
|
|
37988
|
+
result = result.insert(3, "0");
|
|
37989
|
+
if (result.value.length > 4)
|
|
37990
|
+
result = result.insert(5, this.seperator);
|
|
37991
|
+
return Object.assign(Object.assign({}, result), { type: "text", length: [0, 10], pattern: new RegExp(["^(0[1-9]|[12][0-9]|3[01])", "(0[1-9]|1[012])", "\\d{4}$"].join(this.seperator)) });
|
|
37992
|
+
}
|
|
37993
|
+
allowed(symbol, state) {
|
|
37994
|
+
return state.selection.start == 1 && state.value[0] == "3"
|
|
37995
|
+
? symbol >= "0" && symbol <= "1"
|
|
37996
|
+
: state.selection.start == 1 && state.value[0] == "0"
|
|
37997
|
+
? symbol >= "1" && symbol <= "9"
|
|
37998
|
+
: state.selection.start == 2
|
|
37999
|
+
? symbol >= "0" &&
|
|
38000
|
+
symbol <= "9" &&
|
|
38001
|
+
(symbol == "0" || symbol == "1" || this.validMonth(state.value.substring(0, 2), symbol))
|
|
38002
|
+
: state.selection.start == 3
|
|
38003
|
+
? symbol >= "0" && symbol <= "9" && this.validMonth(state.value.substring(0, 2), state.value[2] + symbol)
|
|
38004
|
+
: state.selection.start == 7
|
|
38005
|
+
? symbol >= "0" &&
|
|
38006
|
+
symbol <= "9" &&
|
|
38007
|
+
this.validMonth(state.value.substring(0, 2), state.value.substring(2, 4), state.value.substring(4, 7) + symbol)
|
|
38008
|
+
: state.selection.start < 8 && symbol >= "0" && symbol <= "9";
|
|
37953
38009
|
}
|
|
37954
|
-
return result;
|
|
37955
38010
|
}
|
|
37956
|
-
|
|
37957
|
-
|
|
38011
|
+
Base_1.register("dd.mm.YYYY", () => new Handler("."));
|
|
38012
|
+
Base_1.register("dd/mm/YYYY", () => new Handler("/"));
|
|
38013
|
+
Base_1.register("dd-mm-YYYY", () => new Handler("-"));
|
|
38014
|
+
//# sourceMappingURL=dmy.js.map
|
|
37958
38015
|
});
|
|
37959
38016
|
|
|
37960
|
-
|
|
38017
|
+
createCommonjsModule(function (module, exports) {
|
|
37961
38018
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37962
|
-
exports.formatDate = void 0;
|
|
37963
38019
|
|
|
37964
38020
|
|
|
38021
|
+
class Handler extends Base_1.Base {
|
|
38022
|
+
constructor(seperator) {
|
|
38023
|
+
super(seperator);
|
|
38024
|
+
}
|
|
38025
|
+
toString(data) {
|
|
38026
|
+
return data.length == 10
|
|
38027
|
+
? [data.substring(5, 7), data.substring(8, 10), data.substring(0, 4)].join(this.seperator)
|
|
38028
|
+
: "";
|
|
38029
|
+
}
|
|
38030
|
+
fromString(value) {
|
|
38031
|
+
const result = value.length == 8 ? `${value.substring(4, 8)}-${value.substring(0, 2)}-${value.substring(2, 4)}` : undefined;
|
|
38032
|
+
return dist$3.Date.is(result) ? result : undefined;
|
|
38033
|
+
}
|
|
38034
|
+
format(unformatted) {
|
|
38035
|
+
let result = unformatted;
|
|
38036
|
+
if (result.get(0, 1) > "1")
|
|
38037
|
+
result = result.insert(0, "0");
|
|
38038
|
+
if (result.value.length > 1)
|
|
38039
|
+
result = result.insert(2, this.seperator);
|
|
38040
|
+
if (result.get(3, 1) > (result.get(0, 2) == "02" ? "2" : "3"))
|
|
38041
|
+
result = result.insert(3, "0");
|
|
38042
|
+
if (result.value.length > 4)
|
|
38043
|
+
result = result.insert(5, this.seperator);
|
|
38044
|
+
return Object.assign(Object.assign({}, result), { type: "text", length: [0, 10], pattern: new RegExp(["^(0[1-9]|1[012])", "(0[1-9]|[12][0-9]|3[01])", "\\d{4}$"].join(this.seperator)) });
|
|
38045
|
+
}
|
|
38046
|
+
allowed(symbol, state) {
|
|
38047
|
+
const result = state.selection.start == 1 && state.value[0] == "1"
|
|
38048
|
+
? symbol >= "0" && symbol <= "2"
|
|
38049
|
+
: state.selection.start == 1 && state.value[0] == "0"
|
|
38050
|
+
? symbol >= "1" && symbol <= "9"
|
|
38051
|
+
: state.selection.start == 3
|
|
38052
|
+
? symbol >= "0" && symbol <= "9" && this.validMonth(state.value[2] + symbol, state.value.substring(0, 2))
|
|
38053
|
+
: state.selection.start == 7
|
|
38054
|
+
? symbol >= "0" &&
|
|
38055
|
+
symbol <= "9" &&
|
|
38056
|
+
this.validMonth(state.value.substring(2, 4), state.value.substring(0, 2), state.value.substring(4, 7) + symbol)
|
|
38057
|
+
: state.selection.start < 8 && symbol >= "0" && symbol <= "9";
|
|
38058
|
+
return result;
|
|
38059
|
+
}
|
|
38060
|
+
}
|
|
38061
|
+
Base_1.register("mm/dd/YYYY", () => new Handler("/"));
|
|
38062
|
+
//# sourceMappingURL=mdy.js.map
|
|
38063
|
+
});
|
|
38064
|
+
|
|
38065
|
+
createCommonjsModule(function (module, exports) {
|
|
38066
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37965
38067
|
|
|
37966
38068
|
|
|
37967
|
-
class Handler {
|
|
37968
|
-
constructor(
|
|
37969
|
-
|
|
37970
|
-
this.locale = dist$3.Locale.is(formatting)
|
|
37971
|
-
? formatting
|
|
37972
|
-
: DateFormat_1.DateFormat.is(formatting)
|
|
37973
|
-
? DateFormat_1.DateFormat.toLocale(formatting)
|
|
37974
|
-
: undefined;
|
|
38069
|
+
class Handler extends Base_1.Base {
|
|
38070
|
+
constructor(seperator) {
|
|
38071
|
+
super(seperator);
|
|
37975
38072
|
}
|
|
37976
38073
|
toString(data) {
|
|
37977
|
-
return typeof data != "string" ? "" :
|
|
38074
|
+
return typeof data != "string" ? "" : data;
|
|
37978
38075
|
}
|
|
37979
38076
|
fromString(value) {
|
|
37980
|
-
|
|
37981
|
-
switch (this.formatting) {
|
|
37982
|
-
case "dd/mm/YYYY":
|
|
37983
|
-
case "dd.mm.YYYY":
|
|
37984
|
-
result = `${value.substring(6, 10)}-${value.substring(3, 5)}-${value.substring(0, 2)}`;
|
|
37985
|
-
break;
|
|
37986
|
-
case "mm/dd/YYYY":
|
|
37987
|
-
result = `${value.substring(6, 10)}-${value.substring(0, 2)}-${value.substring(3, 5)}`;
|
|
37988
|
-
break;
|
|
37989
|
-
default:
|
|
37990
|
-
result = value;
|
|
37991
|
-
break;
|
|
37992
|
-
}
|
|
38077
|
+
const result = value.length == 8 ? `${value.substring(0, 4)}-${value.substring(4, 6)}-${value.substring(6, 8)}` : undefined;
|
|
37993
38078
|
return dist$3.Date.is(result) ? result : undefined;
|
|
37994
38079
|
}
|
|
37995
|
-
format(
|
|
37996
|
-
let result;
|
|
37997
|
-
|
|
37998
|
-
|
|
37999
|
-
|
|
38000
|
-
|
|
38001
|
-
|
|
38002
|
-
result =
|
|
38003
|
-
|
|
38004
|
-
|
|
38005
|
-
|
|
38006
|
-
break;
|
|
38007
|
-
default:
|
|
38008
|
-
result = Object.assign(Object.assign({}, formatDate(unformated)), { type: "text", length: [0, 10], pattern: /^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/ });
|
|
38009
|
-
break;
|
|
38080
|
+
format(unformatted) {
|
|
38081
|
+
let result = unformatted;
|
|
38082
|
+
if (result.value.length > 3) {
|
|
38083
|
+
result = result.insert(4, this.seperator);
|
|
38084
|
+
if (result.get(5, 1) > "1")
|
|
38085
|
+
result = result.insert(5, "0");
|
|
38086
|
+
if (result.value.length > 6) {
|
|
38087
|
+
result = result.insert(7, this.seperator);
|
|
38088
|
+
if (result.get(8, 1) > this.daysInMonth(unformatted.value).toString().substring(0, 1))
|
|
38089
|
+
result = result.insert(8, "0");
|
|
38090
|
+
}
|
|
38010
38091
|
}
|
|
38011
|
-
return result;
|
|
38092
|
+
return Object.assign(Object.assign({}, result), { type: "text", length: [0, 10], pattern: new RegExp(["^\\d{4}", "(0[1-9]|1[012])", "(0[1-9]|[12][0-9]|3[01])$"].join(this.seperator)) });
|
|
38093
|
+
}
|
|
38094
|
+
allowed(symbol, state) {
|
|
38095
|
+
const daysInMonth = this.daysInMonth(state.value);
|
|
38096
|
+
return state.selection.start == 5 && state.value[4] == "0"
|
|
38097
|
+
? symbol >= "1" && symbol <= "9"
|
|
38098
|
+
: state.selection.start == 5 && state.value[4] == "1"
|
|
38099
|
+
? symbol >= "0" && symbol <= "2"
|
|
38100
|
+
: state.selection.start == 7 && state.value[6] == "0"
|
|
38101
|
+
? symbol >= "1" && symbol <= "9"
|
|
38102
|
+
: state.selection.start == 7 && ((state.value[6] == "2" && daysInMonth < 30) || state.value[6] == "3")
|
|
38103
|
+
? symbol >= "0" && symbol <= daysInMonth.toString().substring(1)
|
|
38104
|
+
: state.selection.start < 8 && symbol >= "0" && symbol <= "9";
|
|
38105
|
+
}
|
|
38106
|
+
}
|
|
38107
|
+
Base_1.register("YYYY-mm-dd", () => new Handler("-"));
|
|
38108
|
+
//# sourceMappingURL=ymd.js.map
|
|
38109
|
+
});
|
|
38110
|
+
|
|
38111
|
+
createCommonjsModule(function (module, exports) {
|
|
38112
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38113
|
+
|
|
38114
|
+
|
|
38115
|
+
|
|
38116
|
+
//# sourceMappingURL=index.js.map
|
|
38117
|
+
});
|
|
38118
|
+
|
|
38119
|
+
createCommonjsModule(function (module, exports) {
|
|
38120
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38121
|
+
exports.formatDate = void 0;
|
|
38122
|
+
|
|
38123
|
+
|
|
38124
|
+
class Handler {
|
|
38125
|
+
toString(data) {
|
|
38126
|
+
return typeof data == "string" ? data : "";
|
|
38127
|
+
}
|
|
38128
|
+
fromString(value) {
|
|
38129
|
+
let result = value.replace(" ", "T");
|
|
38130
|
+
const fillerDate = "0000-01-01T00:00:00.000Z";
|
|
38131
|
+
if (result === null || result === void 0 ? void 0 : result.match(/-\d$/))
|
|
38132
|
+
result = result.substring(0, result.length - 1) + "0" + result.substring(result.length - 1, result.length);
|
|
38133
|
+
result = !result.match(/^\d{4}-(0[1-9]|1[012])/)
|
|
38134
|
+
? undefined
|
|
38135
|
+
: result + fillerDate.substring(result.length, fillerDate.length);
|
|
38136
|
+
return dist$3.DateTime.is(result) ? result : undefined;
|
|
38137
|
+
}
|
|
38138
|
+
format(unformated) {
|
|
38139
|
+
let result = formatDate(unformated);
|
|
38140
|
+
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[\d:.-]$/))
|
|
38141
|
+
result = result.insert(10, " ");
|
|
38142
|
+
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 3$/))
|
|
38143
|
+
result = result.replace(11, 12, "23:");
|
|
38144
|
+
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) [45]$/))
|
|
38145
|
+
result = result.insert(11, "23:");
|
|
38146
|
+
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) [6-9]$/))
|
|
38147
|
+
result = result.insert(11, "23:5");
|
|
38148
|
+
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 24$/))
|
|
38149
|
+
result = result.replace(10, 13, "00:");
|
|
38150
|
+
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 25$/))
|
|
38151
|
+
result = result.insert(12, "3:");
|
|
38152
|
+
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 2[6-9]$/))
|
|
38153
|
+
result = result.insert(12, "3:5").append(":");
|
|
38154
|
+
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3])\d[\s\S]$/))
|
|
38155
|
+
result = result.insert(13, ":");
|
|
38156
|
+
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3]):[6-9]$/))
|
|
38157
|
+
result = result.insert(14, "5");
|
|
38158
|
+
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3]):[0-5]\d\d$/))
|
|
38159
|
+
result = result.insert(16, ":");
|
|
38160
|
+
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3]):[0-5]\d:[6-9]$/))
|
|
38161
|
+
result = result.insert(17, "5");
|
|
38162
|
+
return Object.assign(Object.assign({}, result), { type: "text", length: [0, 19], pattern: /^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3])(:[0-5]\d){2}$/ });
|
|
38012
38163
|
}
|
|
38013
38164
|
unformat(formated) {
|
|
38014
38165
|
return formated;
|
|
38015
38166
|
}
|
|
38016
38167
|
allowed(symbol, state) {
|
|
38017
|
-
|
|
38018
|
-
|
|
38168
|
+
return (state.value.length < 19 &&
|
|
38169
|
+
((symbol >= "0" && symbol <= "9") || symbol == "-" || symbol == ":" || symbol == "." || symbol == " "));
|
|
38019
38170
|
}
|
|
38020
38171
|
}
|
|
38021
|
-
base.add("date", (
|
|
38172
|
+
base.add("date-time", () => new Handler());
|
|
38022
38173
|
function formatDate(unformated, format) {
|
|
38023
38174
|
let result = unformated;
|
|
38024
38175
|
switch (format) {
|
|
@@ -38049,7 +38200,7 @@ function formatDate(unformated, format) {
|
|
|
38049
38200
|
break;
|
|
38050
38201
|
default:
|
|
38051
38202
|
if (unformated.value.length == 10) {
|
|
38052
|
-
if (!validDate(result.value))
|
|
38203
|
+
if (!validDate(result.value)) {
|
|
38053
38204
|
result = result.replace(0, 10, validDate(result.value.substring(0, 8) + "31")
|
|
38054
38205
|
? result.value.substring(0, 8) + "31"
|
|
38055
38206
|
: validDate(result.value.substring(0, 8) + "30")
|
|
@@ -38059,7 +38210,9 @@ function formatDate(unformated, format) {
|
|
|
38059
38210
|
: validDate(result.value.substring(0, 8) + "28")
|
|
38060
38211
|
? result.value.substring(0, 8) + "28"
|
|
38061
38212
|
: result.value);
|
|
38062
|
-
|
|
38213
|
+
break;
|
|
38214
|
+
}
|
|
38215
|
+
return unformated;
|
|
38063
38216
|
}
|
|
38064
38217
|
}
|
|
38065
38218
|
return result;
|
|
@@ -38069,29 +38222,24 @@ function validDate(date, format) {
|
|
|
38069
38222
|
let year;
|
|
38070
38223
|
let month;
|
|
38071
38224
|
let day;
|
|
38072
|
-
let result;
|
|
38073
38225
|
switch (format) {
|
|
38074
38226
|
case "dd/mm/YYYY":
|
|
38075
38227
|
case "dd.mm.YYYY":
|
|
38076
38228
|
year = parseInt(date.substring(6, 10));
|
|
38077
38229
|
month = parseInt(date.substring(3, 5));
|
|
38078
38230
|
day = parseInt(date.substring(0, 2));
|
|
38079
|
-
|
|
38080
|
-
break;
|
|
38231
|
+
return year && month && day ? day > 0 && daysPerMonth(year, month) >= day : false;
|
|
38081
38232
|
case "mm/dd/YYYY":
|
|
38082
38233
|
year = parseInt(date.substring(6, 10));
|
|
38083
38234
|
month = parseInt(date.substring(0, 2));
|
|
38084
38235
|
day = parseInt(date.substring(3, 5));
|
|
38085
|
-
|
|
38086
|
-
break;
|
|
38236
|
+
return year && month && day ? day > 0 && daysPerMonth(year, month) >= day : false;
|
|
38087
38237
|
default:
|
|
38088
38238
|
year = parseInt(date.substring(0, 4));
|
|
38089
38239
|
month = parseInt(date.substring(5, 7));
|
|
38090
38240
|
day = parseInt(date.substring(8, 10));
|
|
38091
|
-
|
|
38092
|
-
break;
|
|
38241
|
+
return year && month && day ? day > 0 && daysPerMonth(year, month) >= day : false;
|
|
38093
38242
|
}
|
|
38094
|
-
return result;
|
|
38095
38243
|
}
|
|
38096
38244
|
function daysPerMonth(year, month) {
|
|
38097
38245
|
let result;
|
|
@@ -38118,63 +38266,6 @@ function daysPerMonth(year, month) {
|
|
|
38118
38266
|
}
|
|
38119
38267
|
return result;
|
|
38120
38268
|
}
|
|
38121
|
-
//# sourceMappingURL=index.js.map
|
|
38122
|
-
});
|
|
38123
|
-
|
|
38124
|
-
createCommonjsModule(function (module, exports) {
|
|
38125
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38126
|
-
|
|
38127
|
-
|
|
38128
|
-
|
|
38129
|
-
class Handler {
|
|
38130
|
-
toString(data) {
|
|
38131
|
-
return typeof data == "string" ? data : "";
|
|
38132
|
-
}
|
|
38133
|
-
fromString(value) {
|
|
38134
|
-
let result = value.replace(" ", "T");
|
|
38135
|
-
const fillerDate = "0000-01-01T00:00:00.000Z";
|
|
38136
|
-
if (result === null || result === void 0 ? void 0 : result.match(/-\d$/))
|
|
38137
|
-
result = result.substring(0, result.length - 1) + "0" + result.substring(result.length - 1, result.length);
|
|
38138
|
-
result = !result.match(/^\d{4}-(0[1-9]|1[012])/)
|
|
38139
|
-
? undefined
|
|
38140
|
-
: result + fillerDate.substring(result.length, fillerDate.length);
|
|
38141
|
-
return dist$3.DateTime.is(result) ? result : undefined;
|
|
38142
|
-
}
|
|
38143
|
-
format(unformated) {
|
|
38144
|
-
let result = date.formatDate(unformated);
|
|
38145
|
-
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[\d:.-]$/))
|
|
38146
|
-
result = result.insert(10, " ");
|
|
38147
|
-
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 3$/))
|
|
38148
|
-
result = result.replace(11, 12, "23:");
|
|
38149
|
-
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) [45]$/))
|
|
38150
|
-
result = result.insert(11, "23:");
|
|
38151
|
-
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) [6-9]$/))
|
|
38152
|
-
result = result.insert(11, "23:5");
|
|
38153
|
-
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 24$/))
|
|
38154
|
-
result = result.replace(10, 13, "00:");
|
|
38155
|
-
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 25$/))
|
|
38156
|
-
result = result.insert(12, "3:");
|
|
38157
|
-
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) 2[6-9]$/))
|
|
38158
|
-
result = result.insert(12, "3:5").append(":");
|
|
38159
|
-
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3])\d[\s\S]$/))
|
|
38160
|
-
result = result.insert(13, ":");
|
|
38161
|
-
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3]):[6-9]$/))
|
|
38162
|
-
result = result.insert(14, "5");
|
|
38163
|
-
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3]):[0-5]\d\d$/))
|
|
38164
|
-
result = result.insert(16, ":");
|
|
38165
|
-
if (result.match(/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3]):[0-5]\d:[6-9]$/))
|
|
38166
|
-
result = result.insert(17, "5");
|
|
38167
|
-
return Object.assign(Object.assign({}, result), { type: "text", length: [0, 19], pattern: /^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([0-1]\d|2[0-3])(:[0-5]\d){2}$/ });
|
|
38168
|
-
}
|
|
38169
|
-
unformat(formated) {
|
|
38170
|
-
return formated;
|
|
38171
|
-
}
|
|
38172
|
-
allowed(symbol, state) {
|
|
38173
|
-
return (state.value.length < 19 &&
|
|
38174
|
-
((symbol >= "0" && symbol <= "9") || symbol == "-" || symbol == ":" || symbol == "." || symbol == " "));
|
|
38175
|
-
}
|
|
38176
|
-
}
|
|
38177
|
-
base.add("date-time", () => new Handler());
|
|
38178
38269
|
//# sourceMappingURL=date-time.js.map
|
|
38179
38270
|
});
|
|
38180
38271
|
|
|
@@ -39546,7 +39637,7 @@ let SmoothlyIconDemo = class {
|
|
|
39546
39637
|
};
|
|
39547
39638
|
SmoothlyIconDemo.style = styleCss$s;
|
|
39548
39639
|
|
|
39549
|
-
const styleCss$r = ".sc-smoothly-input-h{display:block;position:relative}[hidden].sc-smoothly-input-h{display:none}label.sc-smoothly-input{position:absolute;left:0.4em;top:0.6em;color:rgb(var(--smoothly-text-tint));opacity:0.8;user-select:none;cursor:inherit;transition:font-size 0.1s;transition-timing-function:ease}input.sc-smoothly-input{padding:1em 0.2em 0.2em 0.2em;width:calc(100% - 0.4em);background:none;border:0;z-index:1;position:relative;font-size:1rem;font-family:var(--smoothly-font-family)}smoothly-icon.sc-smoothly-input{display:none;position:absolute;right:0.2em;top:0.6em}input.sc-smoothly-input:invalid+smoothly-icon.sc-smoothly-input{display:block}.has-value.sc-smoothly-input-h>label.sc-smoothly-input{top:0.3em;top:0.4em;font-size:60%;z-index:0}.sc-smoothly-input-h:focus-within>label.sc-smoothly-input{top:0.3em;top:0.4em;font-size:60%;z-index:0}input.sc-smoothly-input:focus{outline:none}input.sc-smoothly-input:-webkit-autofill,input.sc-smoothly-input:-webkit-autofill:hover,input.sc-smoothly-input:-webkit-autofill:focus,input.sc-smoothly-input:-webkit-autofill:active{box-shadow:0 0 0 30px unset inset !important;-webkit-box-shadow:0 0 0 30px unset inset !important}input.sc-smoothly-input:-webkit-autofill{-webkit-text-fill-color:unset !important}input.sc-smoothly-input:-internal-autofill-previewed,input.sc-smoothly-input:-internal-autofill-selected,textarea.sc-smoothly-input:-internal-autofill-previewed,textarea.sc-smoothly-input:-internal-autofill-selected,select.sc-smoothly-input:-internal-autofill-previewed,select.sc-smoothly-input:-internal-autofill-selected{background-color:none !important;background-image:none !important;color:unset !important}";
|
|
39640
|
+
const styleCss$r = ".sc-smoothly-input-h{display:block;position:relative;font-weight:var(--smoothly-font-weight)}[hidden].sc-smoothly-input-h{display:none}label.sc-smoothly-input{position:absolute;left:0.4em;top:0.6em;color:rgb(var(--smoothly-text-tint));opacity:0.8;user-select:none;cursor:inherit;transition:font-size 0.1s;transition-timing-function:ease}input.sc-smoothly-input{padding:1em 0.2em 0.2em 0.2em;width:calc(100% - 0.4em);background:none;border:0;z-index:1;position:relative;font-size:1rem;font-family:var(--smoothly-font-family)}smoothly-icon.sc-smoothly-input{display:none;position:absolute;right:0.2em;top:0.6em}input.sc-smoothly-input:invalid+smoothly-icon.sc-smoothly-input{display:block}.has-value.sc-smoothly-input-h>label.sc-smoothly-input{top:0.3em;top:0.4em;font-size:60%;z-index:0}.sc-smoothly-input-h:focus-within>label.sc-smoothly-input{top:0.3em;top:0.4em;font-size:60%;z-index:0}input.sc-smoothly-input:focus{outline:none}input.sc-smoothly-input:-webkit-autofill,input.sc-smoothly-input:-webkit-autofill:hover,input.sc-smoothly-input:-webkit-autofill:focus,input.sc-smoothly-input:-webkit-autofill:active{box-shadow:0 0 0 30px unset inset !important;-webkit-box-shadow:0 0 0 30px unset inset !important}input.sc-smoothly-input:-webkit-autofill{-webkit-text-fill-color:unset !important}input.sc-smoothly-input:-internal-autofill-previewed,input.sc-smoothly-input:-internal-autofill-selected,textarea.sc-smoothly-input:-internal-autofill-previewed,textarea.sc-smoothly-input:-internal-autofill-selected,select.sc-smoothly-input:-internal-autofill-previewed,select.sc-smoothly-input:-internal-autofill-selected{background-color:none !important;background-image:none !important;color:unset !important}";
|
|
39550
39641
|
|
|
39551
39642
|
let SmoothlyInput = class {
|
|
39552
39643
|
constructor(hostRef) {
|
|
@@ -39698,8 +39789,8 @@ let SmoothlyInput = class {
|
|
|
39698
39789
|
this.value = this.lastValue = this.formatter.fromString(this.formatter.unformat(dist.StateEditor.copy(Object.assign({}, this.state))).value);
|
|
39699
39790
|
}
|
|
39700
39791
|
render() {
|
|
39701
|
-
var _a;
|
|
39702
|
-
return (h(Host, { class: { "has-value": ((_a = this.state) === null || _a === void 0 ? void 0 : _a.value) != "" } }, h("input", { name: this.name, type: this.state.type, placeholder: this.placeholder, required: this.required, autocomplete: this.autocomplete ? this.state.autocomplete : "off", disabled: this.disabled, pattern: this.state.pattern && this.state.pattern.source, value: this.state.value, onInput: (e) => this.onInput(e), onFocus: e => this.onFocus(e), onClick: e => this.onClick(e), onBlur: e => this.onBlur(e), onKeyDown: e => this.onKeyDown(e), ref: (el) => (this.inputElement = el), onPaste: e => this.onPaste(e) }), h("smoothly-icon", { name: "alert-circle", color: "danger", fill: "clear", size: "small" }), h("label", { htmlFor: this.name }, h("slot", null))));
|
|
39792
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
39793
|
+
return (h(Host, { class: { "has-value": ((_a = this.state) === null || _a === void 0 ? void 0 : _a.value) != undefined && ((_b = this.state) === null || _b === void 0 ? void 0 : _b.value) != "" } }, h("input", { name: this.name, type: (_c = this.state) === null || _c === void 0 ? void 0 : _c.type, placeholder: this.placeholder, required: this.required, autocomplete: this.autocomplete ? (_d = this.state) === null || _d === void 0 ? void 0 : _d.autocomplete : "off", disabled: this.disabled, pattern: ((_e = this.state) === null || _e === void 0 ? void 0 : _e.pattern) && ((_f = this.state) === null || _f === void 0 ? void 0 : _f.pattern.source), value: (_g = this.state) === null || _g === void 0 ? void 0 : _g.value, onInput: (e) => this.onInput(e), onFocus: e => this.onFocus(e), onClick: e => this.onClick(e), onBlur: e => this.onBlur(e), onKeyDown: e => this.onKeyDown(e), ref: (el) => (this.inputElement = el), onPaste: e => this.onPaste(e) }), h("smoothly-icon", { name: "alert-circle", color: "danger", fill: "clear", size: "small" }), h("label", { htmlFor: this.name }, h("slot", null))));
|
|
39703
39794
|
}
|
|
39704
39795
|
static get watchers() { return {
|
|
39705
39796
|
"value": ["valueWatcher"]
|
|
@@ -39721,6 +39812,10 @@ let InputDate = class {
|
|
|
39721
39812
|
onStart(next) {
|
|
39722
39813
|
this.valueChanged.emit(next);
|
|
39723
39814
|
}
|
|
39815
|
+
dateSetHandler(e) {
|
|
39816
|
+
this.open = false;
|
|
39817
|
+
e.stopPropagation();
|
|
39818
|
+
}
|
|
39724
39819
|
render() {
|
|
39725
39820
|
var _a;
|
|
39726
39821
|
return [
|
|
@@ -39749,16 +39844,18 @@ let InputDateRange = class {
|
|
|
39749
39844
|
onValue(next) {
|
|
39750
39845
|
this.valueChanged.emit(next);
|
|
39751
39846
|
}
|
|
39752
|
-
onClose(open) {
|
|
39753
|
-
if (open == false && dist$3.Date.is(this.start) && dist$3.Date.is(this.end))
|
|
39754
|
-
this.dateRangeSelected.emit({ start: this.start, end: this.end });
|
|
39755
|
-
}
|
|
39756
39847
|
onStartChanged(event) {
|
|
39757
39848
|
this.start = event.detail;
|
|
39758
39849
|
}
|
|
39759
39850
|
onEndChanged(event) {
|
|
39760
39851
|
this.end = event.detail;
|
|
39761
39852
|
}
|
|
39853
|
+
onDateRangeSet(event) {
|
|
39854
|
+
console.log("dateRangeSet", event.detail);
|
|
39855
|
+
this.open = false;
|
|
39856
|
+
event.stopPropagation();
|
|
39857
|
+
dist$3.DateRange.is(event.detail) && this.dateRangeSelected.emit(event.detail);
|
|
39858
|
+
}
|
|
39762
39859
|
render() {
|
|
39763
39860
|
var _a;
|
|
39764
39861
|
return [
|
|
@@ -39767,14 +39864,11 @@ let InputDateRange = class {
|
|
|
39767
39864
|
this.open ? (h("nav", null, h("div", { class: "arrow" }), h("smoothly-calendar", { doubleInput: true, value: (_a = this.value) !== null && _a !== void 0 ? _a : dist$3.Date.now(), onValueChanged: event => {
|
|
39768
39865
|
this.value = event.detail;
|
|
39769
39866
|
event.stopPropagation();
|
|
39770
|
-
}, max: this.max, min: this.min }))) : ([]),
|
|
39867
|
+
}, start: this.start, end: this.end, max: this.max, min: this.min }))) : ([]),
|
|
39771
39868
|
];
|
|
39772
39869
|
}
|
|
39773
39870
|
static get watchers() { return {
|
|
39774
|
-
"value": ["onValue"]
|
|
39775
|
-
"open": ["onClose"],
|
|
39776
|
-
"start": ["onClose"],
|
|
39777
|
-
"end": ["onClose"]
|
|
39871
|
+
"value": ["onValue"]
|
|
39778
39872
|
}; }
|
|
39779
39873
|
};
|
|
39780
39874
|
InputDateRange.style = styleCss$p;
|
|
@@ -40319,6 +40413,7 @@ let SmoothlySelectDemo = class {
|
|
|
40319
40413
|
h("smoothly-select", { identifier: "currency" }, this.currencies.map(option => this.currency == option ? (h("option", { value: option, selected: true }, option)) : (h("option", { value: option }, option)))),
|
|
40320
40414
|
h("smoothly-select", { identifier: "language" }, h("optgroup", { label: "Nordic" }, h("option", { value: "sv" }, "Swedish"), h("option", { value: "da", selected: true }, "Danish"), h("option", { value: "no" }, "Norwegian")), h("optgroup", { label: "Other" }, h("option", { value: "en" }, "English"))),
|
|
40321
40415
|
h("smoothly-select", { identifier: "quantity", ref: e => (this.quantityElement = e) }, h("option", { value: "1" }, "1"), h("option", { value: "2" }, "2"), h("option", { value: "3" }, "3")),
|
|
40416
|
+
h("smoothly-input-date", null, "Date"),
|
|
40322
40417
|
h("smoothly-input-date", { value: "2021-10-28", max: "2021-12-30", min: "2021-10-10" }, "Date"),
|
|
40323
40418
|
h("smoothly-input-date-range", { start: "2021-10-28", end: "2021-11-27", min: "2021-10-10", max: "2021-12-30" }),
|
|
40324
40419
|
h("smoothly-selector", null, h("smoothly-item", { value: "1" }, "January"), h("smoothly-item", { value: "2" }, "February"), h("smoothly-item", { value: "3" }, "March"), h("smoothly-item", { value: "4" }, "April"), h("smoothly-item", { value: "5" }, "May"), h("smoothly-item", { value: "6" }, "June"), h("smoothly-item", { value: "7" }, "July"), h("smoothly-item", { value: "8" }, "August"), h("smoothly-item", { value: "9" }, "September"), h("smoothly-item", { value: "10" }, "October"), h("smoothly-item", { value: "11" }, "November"), h("smoothly-item", { value: "12" }, "December")),
|