@limetech/lime-crm-building-blocks 1.2.0 → 1.3.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/dist/cjs/{index-9b027564.js → index-bea86c2b.js} +16 -0
- package/dist/cjs/lime-crm-building-blocks.cjs.js +2 -2
- package/dist/cjs/limebb-currency-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-date-range.cjs.entry.js +58 -0
- package/dist/cjs/limebb-example-currency-picker-european.cjs.entry.js +1 -1
- package/dist/cjs/limebb-example-currency-picker-nordic.cjs.entry.js +1 -1
- package/dist/cjs/limebb-example-currency-picker.cjs.entry.js +1 -1
- package/dist/cjs/limebb-example-date-range.cjs.entry.js +24 -0
- package/dist/cjs/limebb-example-navigation-button-back.cjs.entry.js +1 -1
- package/dist/cjs/limebb-example-navigation-button-close.cjs.entry.js +1 -1
- package/dist/cjs/limebb-example-navigation-button-expand.cjs.entry.js +1 -1
- package/dist/cjs/limebb-example-navigation-button-float.cjs.entry.js +1 -1
- package/dist/cjs/limebb-example-navigation-button-new-tab.cjs.entry.js +1 -1
- package/dist/cjs/limebb-example-navigation-button-shrink.cjs.entry.js +1 -1
- package/dist/cjs/limebb-navigation-button.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/date-range/date-range.css +59 -0
- package/dist/collection/components/date-range/date-range.js +253 -0
- package/dist/collection/components/date-range/examples/date-range.css +29 -0
- package/dist/collection/components/date-range/examples/date-range.js +28 -0
- package/dist/components/date-range.js +77 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/limebb-date-range.d.ts +11 -0
- package/dist/components/limebb-date-range.js +6 -0
- package/dist/components/limebb-example-date-range.d.ts +11 -0
- package/dist/components/limebb-example-date-range.js +44 -0
- package/dist/esm/{index-61b37c41.js → index-0d527d0b.js} +16 -0
- package/dist/esm/lime-crm-building-blocks.js +3 -3
- package/dist/esm/limebb-currency-picker.entry.js +1 -1
- package/dist/esm/limebb-date-range.entry.js +54 -0
- package/dist/esm/limebb-example-currency-picker-european.entry.js +1 -1
- package/dist/esm/limebb-example-currency-picker-nordic.entry.js +1 -1
- package/dist/esm/limebb-example-currency-picker.entry.js +1 -1
- package/dist/esm/limebb-example-date-range.entry.js +20 -0
- package/dist/esm/limebb-example-navigation-button-back.entry.js +1 -1
- package/dist/esm/limebb-example-navigation-button-close.entry.js +1 -1
- package/dist/esm/limebb-example-navigation-button-expand.entry.js +1 -1
- package/dist/esm/limebb-example-navigation-button-float.entry.js +1 -1
- package/dist/esm/limebb-example-navigation-button-new-tab.entry.js +1 -1
- package/dist/esm/limebb-example-navigation-button-shrink.entry.js +1 -1
- package/dist/esm/limebb-navigation-button.entry.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/lime-crm-building-blocks/lime-crm-building-blocks.esm.js +1 -1
- package/dist/lime-crm-building-blocks/{p-d9b23842.entry.js → p-12af97dc.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-3d712686.entry.js → p-1411db7c.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-1a6ab3f4.entry.js → p-19b1e7c4.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-c23d4390.entry.js → p-380233e8.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-892006f7.entry.js → p-3e4d57d6.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-58ec24fa.entry.js +1 -0
- package/dist/lime-crm-building-blocks/p-59499730.js +2 -0
- package/dist/lime-crm-building-blocks/{p-e524aa4a.entry.js → p-80c3f13a.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-b779e432.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-ac0ab1b2.entry.js → p-b7b76ec7.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/p-d0c573b0.entry.js +1 -0
- package/dist/lime-crm-building-blocks/{p-05f1998d.entry.js → p-df83f126.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-f205a442.entry.js → p-dfdc1239.entry.js} +1 -1
- package/dist/lime-crm-building-blocks/{p-1457ed35.entry.js → p-f511342f.entry.js} +1 -1
- package/dist/types/components/date-range/date-range.d.ts +70 -0
- package/dist/types/components/date-range/examples/date-range.d.ts +8 -0
- package/dist/types/components.d.ts +163 -1
- package/package.json +1 -1
- package/dist/lime-crm-building-blocks/p-0123dd0a.js +0 -2
- package/dist/lime-crm-building-blocks/p-4fda5e50.entry.js +0 -1
|
@@ -825,6 +825,11 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
825
825
|
const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
|
|
826
826
|
const instance = hostRef.$lazyInstance$ ;
|
|
827
827
|
let promise;
|
|
828
|
+
if (isInitialLoad) {
|
|
829
|
+
{
|
|
830
|
+
promise = safeCall(instance, 'componentWillLoad');
|
|
831
|
+
}
|
|
832
|
+
}
|
|
828
833
|
endSchedule();
|
|
829
834
|
return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
830
835
|
};
|
|
@@ -934,6 +939,17 @@ const appDidLoad = (who) => {
|
|
|
934
939
|
}
|
|
935
940
|
nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
|
|
936
941
|
};
|
|
942
|
+
const safeCall = (instance, method, arg) => {
|
|
943
|
+
if (instance && instance[method]) {
|
|
944
|
+
try {
|
|
945
|
+
return instance[method](arg);
|
|
946
|
+
}
|
|
947
|
+
catch (e) {
|
|
948
|
+
consoleError(e);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
return undefined;
|
|
952
|
+
};
|
|
937
953
|
const then = (promise, thenFn) => {
|
|
938
954
|
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
|
939
955
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-bea86c2b.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Browser v2.22.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["limebb-example-currency-picker.cjs",[[1,"limebb-example-currency-picker",{"selectedCurrency":[32]}]]],["limebb-example-currency-picker-european.cjs",[[1,"limebb-example-currency-picker-european",{"selectedCurrency":[32]}]]],["limebb-example-currency-picker-nordic.cjs",[[1,"limebb-example-currency-picker-nordic",{"selectedCurrency":[32]}]]],["limebb-example-navigation-button-back.cjs",[[1,"limebb-example-navigation-button-back"]]],["limebb-example-navigation-button-close.cjs",[[1,"limebb-example-navigation-button-close"]]],["limebb-example-navigation-button-expand.cjs",[[1,"limebb-example-navigation-button-expand"]]],["limebb-example-navigation-button-float.cjs",[[1,"limebb-example-navigation-button-float"]]],["limebb-example-navigation-button-new-tab.cjs",[[1,"limebb-example-navigation-button-new-tab"]]],["limebb-example-navigation-button-shrink.cjs",[[1,"limebb-example-navigation-button-shrink"]]],["limebb-currency-picker.cjs",[[1,"limebb-currency-picker",{"label":[513],"platform":[16],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"disabled":[516],"value":[16]}]]],["limebb-navigation-button.cjs",[[1,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["limebb-example-currency-picker.cjs",[[1,"limebb-example-currency-picker",{"selectedCurrency":[32]}]]],["limebb-example-currency-picker-european.cjs",[[1,"limebb-example-currency-picker-european",{"selectedCurrency":[32]}]]],["limebb-example-currency-picker-nordic.cjs",[[1,"limebb-example-currency-picker-nordic",{"selectedCurrency":[32]}]]],["limebb-example-date-range.cjs",[[1,"limebb-example-date-range"]]],["limebb-example-navigation-button-back.cjs",[[1,"limebb-example-navigation-button-back"]]],["limebb-example-navigation-button-close.cjs",[[1,"limebb-example-navigation-button-close"]]],["limebb-example-navigation-button-expand.cjs",[[1,"limebb-example-navigation-button-expand"]]],["limebb-example-navigation-button-float.cjs",[[1,"limebb-example-navigation-button-float"]]],["limebb-example-navigation-button-new-tab.cjs",[[1,"limebb-example-navigation-button-new-tab"]]],["limebb-example-navigation-button-shrink.cjs",[[1,"limebb-example-navigation-button-shrink"]]],["limebb-date-range.cjs",[[1,"limebb-date-range",{"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-currency-picker.cjs",[[1,"limebb-currency-picker",{"label":[513],"platform":[16],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"disabled":[516],"value":[16]}]]],["limebb-navigation-button.cjs",[[1,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-bea86c2b.js');
|
|
6
|
+
|
|
7
|
+
const dateRangeCss = ":host(limebb-date-range){isolation:isolate;display:block;position:relative}*{box-sizing:border-box}.date-pickers{display:grid;grid-template-columns:repeat(auto-fit, minmax(13.5rem, 1fr));gap:0.5rem;padding:0.75rem 1rem 1.25rem 1rem}.label-group{display:flex;align-items:center;margin-bottom:0.25rem}.end-time .label-group{flex-direction:row-reverse}.label-group .label{font-size:0.75rem;padding:0 0.25rem}.label-group .circle{flex-shrink:0;width:0.5rem;height:0.5rem;border-radius:50%}.start-time .label-group .circle{background-color:rgb(var(--color-green-default))}.end-time .label-group .circle{background-color:rgb(var(--color-coral-default))}.label-group .line{flex-grow:1;height:0.25rem;border-radius:1rem}.start-time .label-group .line{background-image:linear-gradient(to right, rgb(var(--color-green-light)), rgb(var(--contrast-400)) 30%)}.end-time .label-group .line{background-image:linear-gradient(to left, rgb(var(--color-coral-light)), rgb(var(--contrast-400)) 30%)}.date-pickers:has(>:last-child:nth-child(2)) .start-time .line{margin-right:-0.5rem}.date-pickers:has(>:last-child:nth-child(2)) .end-time .line{margin-left:-0.5rem}";
|
|
8
|
+
|
|
9
|
+
const DateRange = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.changeStartTime = index.createEvent(this, "changeStartTime", 7);
|
|
13
|
+
this.changeEndTime = index.createEvent(this, "changeEndTime", 7);
|
|
14
|
+
this.handleStartTimeChange = (event) => {
|
|
15
|
+
event.stopPropagation();
|
|
16
|
+
this.changeStartTime.emit(event.detail);
|
|
17
|
+
};
|
|
18
|
+
this.handleEndTimeChange = (event) => {
|
|
19
|
+
event.stopPropagation();
|
|
20
|
+
this.changeEndTime.emit(event.detail);
|
|
21
|
+
};
|
|
22
|
+
this.startTime = undefined;
|
|
23
|
+
this.endTime = undefined;
|
|
24
|
+
this.startTimeLabel = undefined;
|
|
25
|
+
this.endTimeLabel = undefined;
|
|
26
|
+
this.language = undefined;
|
|
27
|
+
this.timeFormat = undefined;
|
|
28
|
+
this.type = undefined;
|
|
29
|
+
}
|
|
30
|
+
componentWillLoad() {
|
|
31
|
+
this.originalStartTime = this.startTime;
|
|
32
|
+
this.originalEndTime = this.endTime;
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return (index.h("div", { class: "date-pickers" }, this.renderStartDatePicker(), this.renderEndDatePicker()));
|
|
36
|
+
}
|
|
37
|
+
renderStartDatePicker() {
|
|
38
|
+
if (!this.originalStartTime) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
return (index.h("div", { class: "start-time" }, this.renderDatePicker(this.startTimeLabel, this.startTime, !this.startTime, this.handleStartTimeChange)));
|
|
42
|
+
}
|
|
43
|
+
renderEndDatePicker() {
|
|
44
|
+
if (!this.originalEndTime) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
return (index.h("div", { class: "end-time" }, this.renderDatePicker(this.endTimeLabel, this.endTime, !this.endTime, this.handleEndTimeChange)));
|
|
48
|
+
}
|
|
49
|
+
renderDatePicker(label, value, isInvalid, onChangeHandler) {
|
|
50
|
+
return [
|
|
51
|
+
index.h("div", { class: "label-group" }, index.h("span", { class: "circle" }), index.h("span", { class: "label" }, label), index.h("span", { class: "line" })),
|
|
52
|
+
index.h("limel-date-picker", { type: this.type, value: value, format: this.timeFormat, language: this.language, onChange: onChangeHandler, invalid: isInvalid }),
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
DateRange.style = dateRangeCss;
|
|
57
|
+
|
|
58
|
+
exports.limebb_date_range = DateRange;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-bea86c2b.js');
|
|
6
|
+
|
|
7
|
+
const dateRangeCss = ":host(limebb-example-date-range){display:flex;flex-direction:column;background-color:rgb(var(--contrast-500));border-radius:0.5rem;padding:0.5rem}span{padding-left:0.5rem;font-size:1.25rem}limebb-date-range{margin-top:0.75rem;border-radius:0.75rem;background-color:rgb(var(--contrast-100))}limebb-date-range:before{content:\"\";position:absolute;top:-0.5rem;left:2rem;background-color:inherit;width:1rem;height:1rem;rotate:45deg;border-radius:0.25rem 0 0 0}";
|
|
8
|
+
|
|
9
|
+
const DateRangeExample = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.startTime = new Date('2022-01-02T00:00:00.000Z');
|
|
13
|
+
this.endTime = new Date('2022-01-03T00:00:00.000Z');
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return [
|
|
17
|
+
index.h("span", null, "My event"),
|
|
18
|
+
index.h("limebb-date-range", { startTime: this.startTime, endTime: this.endTime, startTimeLabel: "Start time", endTimeLabel: "End time", type: "datetime" }),
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
DateRangeExample.style = dateRangeCss;
|
|
23
|
+
|
|
24
|
+
exports.limebb_example_date_range = DateRangeExample;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-bea86c2b.js');
|
|
6
6
|
|
|
7
7
|
const navigationButtonCss = ".navigation-button{all:unset;isolation:isolate;position:relative;display:flex;justify-content:center;align-items:center;height:1.875rem;width:1.875rem;border-radius:50%;transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:var(--navigation-button-background-color, var(--lime-elevated-surface-background-color))}.navigation-button:hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.navigation-button:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}.navigation-button:focus{outline:none}.navigation-button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.navigation-button limel-icon{transition:color 0.2s ease, transform 0.2s cubic-bezier(0.84, 0.15, 0.52, 1.42);color:var(--header-menu-icon-color);width:1.25rem}.newTab limel-icon{transition:transform 0.2s ease;transform:scale(0.8);z-index:3}.newTab:before{z-index:2}.newTab::after{z-index:1}.newTab:before,.newTab:after{content:\"\";transition:transform 0.2s ease, border-color 0.2s ease;position:absolute;width:0.875rem;height:0.875rem;border:1px solid rgb(var(--contrast-900));background-color:var(--navigation-button-background-color, rgb(var(--contrast-100)))}.newTab:hover limel-icon{color:var(--mdc-theme-primary);transform:translate3d(-0.1rem, 0.1rem, 0) scale(1)}.newTab:hover:before{transform:translate3d(0.125rem, -0.125rem, 0);border-color:rgb(var(--contrast-1000));box-shadow:var(--shadow-depth-8)}.newTab:hover:after{transform:translate3d(-0.15rem, 0.15rem, 0) scale(0.9);border-color:rgb(var(--contrast-700))}.expand:after{transition:transform 0.2s ease;content:\"\";position:absolute;z-index:1;background-color:var(--navigation-button-background-color, rgb(var(--contrast-100)));width:0.75rem;height:0.75rem}.expand:hover limel-icon{color:var(--mdc-theme-primary)}.expand:hover:after{transform:scale(0.5)}.expand:hover limel-icon{transform:scale(1.18)}.close limel-icon{transition:transform 0.2s ease, color 0.2s ease}.close:before,.close:after{transition-delay:0.1s;content:\"\";position:absolute;inset:0;border-radius:50%;opacity:0}.close:before{transition:transform 0.3s ease, opacity 0.3s ease;background-color:rgb(var(--color-orange-dark))}.close:after{transition:transform 0.6s ease, opacity 0.6s ease;background-color:rgb(var(--color-orange-light))}.close:hover limel-icon{color:rgb(var(--color-white));transform:scale(0.7) rotate(90deg)}.close:hover:before{opacity:1;transform:scale(0.4)}.close:hover:after{opacity:0.4;transform:scale(0.6)}.float:after{transition:width 0.2s ease-out, opacity 0.2s ease;content:\"\";position:absolute;inset:0 0.5rem 0 auto;border-radius:1px;opacity:0.8;transform:translate3d(0, 0, 0);background-color:rgb(var(--contrast-800));width:0.125rem;height:0.6rem;margin:auto}.float:hover:after{width:0.4rem;opacity:1;transform:translate3d(0, 0, 0)}";
|
|
8
8
|
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-bea86c2b.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.22.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["limebb-example-currency-picker.cjs",[[1,"limebb-example-currency-picker",{"selectedCurrency":[32]}]]],["limebb-example-currency-picker-european.cjs",[[1,"limebb-example-currency-picker-european",{"selectedCurrency":[32]}]]],["limebb-example-currency-picker-nordic.cjs",[[1,"limebb-example-currency-picker-nordic",{"selectedCurrency":[32]}]]],["limebb-example-navigation-button-back.cjs",[[1,"limebb-example-navigation-button-back"]]],["limebb-example-navigation-button-close.cjs",[[1,"limebb-example-navigation-button-close"]]],["limebb-example-navigation-button-expand.cjs",[[1,"limebb-example-navigation-button-expand"]]],["limebb-example-navigation-button-float.cjs",[[1,"limebb-example-navigation-button-float"]]],["limebb-example-navigation-button-new-tab.cjs",[[1,"limebb-example-navigation-button-new-tab"]]],["limebb-example-navigation-button-shrink.cjs",[[1,"limebb-example-navigation-button-shrink"]]],["limebb-currency-picker.cjs",[[1,"limebb-currency-picker",{"label":[513],"platform":[16],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"disabled":[516],"value":[16]}]]],["limebb-navigation-button.cjs",[[1,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["limebb-example-currency-picker.cjs",[[1,"limebb-example-currency-picker",{"selectedCurrency":[32]}]]],["limebb-example-currency-picker-european.cjs",[[1,"limebb-example-currency-picker-european",{"selectedCurrency":[32]}]]],["limebb-example-currency-picker-nordic.cjs",[[1,"limebb-example-currency-picker-nordic",{"selectedCurrency":[32]}]]],["limebb-example-date-range.cjs",[[1,"limebb-example-date-range"]]],["limebb-example-navigation-button-back.cjs",[[1,"limebb-example-navigation-button-back"]]],["limebb-example-navigation-button-close.cjs",[[1,"limebb-example-navigation-button-close"]]],["limebb-example-navigation-button-expand.cjs",[[1,"limebb-example-navigation-button-expand"]]],["limebb-example-navigation-button-float.cjs",[[1,"limebb-example-navigation-button-float"]]],["limebb-example-navigation-button-new-tab.cjs",[[1,"limebb-example-navigation-button-new-tab"]]],["limebb-example-navigation-button-shrink.cjs",[[1,"limebb-example-navigation-button-shrink"]]],["limebb-date-range.cjs",[[1,"limebb-date-range",{"startTime":[16],"endTime":[16],"startTimeLabel":[1,"start-time-label"],"endTimeLabel":[1,"end-time-label"],"language":[1],"timeFormat":[1,"time-format"],"type":[1]}]]],["limebb-currency-picker.cjs",[[1,"limebb-currency-picker",{"label":[513],"platform":[16],"currencies":[16],"helperText":[513,"helper-text"],"required":[516],"readonly":[516],"disabled":[516],"value":[16]}]]],["limebb-navigation-button.cjs",[[1,"limebb-navigation-button",{"href":[513],"tooltipLabel":[513,"tooltip-label"],"tooltipHelperLabel":[513,"tooltip-helper-label"],"type":[513]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
"./components/currency-picker/examples/currency-picker-european.js",
|
|
5
5
|
"./components/currency-picker/examples/currency-picker-nordic.js",
|
|
6
6
|
"./components/currency-picker/examples/currency-picker.js",
|
|
7
|
+
"./components/date-range/date-range.js",
|
|
8
|
+
"./components/date-range/examples/date-range.js",
|
|
7
9
|
"./components/navigation-button/navigation-button.js",
|
|
8
10
|
"./components/navigation-button/examples/navigation-button-back.js",
|
|
9
11
|
"./components/navigation-button/examples/navigation-button-close.js",
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
:host(limebb-date-range) {
|
|
2
|
+
isolation: isolate;
|
|
3
|
+
display: block;
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
* {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.date-pickers {
|
|
12
|
+
display: grid;
|
|
13
|
+
grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
|
|
14
|
+
gap: 0.5rem;
|
|
15
|
+
padding: 0.75rem 1rem 1.25rem 1rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.label-group {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
margin-bottom: 0.25rem;
|
|
22
|
+
}
|
|
23
|
+
.end-time .label-group {
|
|
24
|
+
flex-direction: row-reverse;
|
|
25
|
+
}
|
|
26
|
+
.label-group .label {
|
|
27
|
+
font-size: 0.75rem;
|
|
28
|
+
padding: 0 0.25rem;
|
|
29
|
+
}
|
|
30
|
+
.label-group .circle {
|
|
31
|
+
flex-shrink: 0;
|
|
32
|
+
width: 0.5rem;
|
|
33
|
+
height: 0.5rem;
|
|
34
|
+
border-radius: 50%;
|
|
35
|
+
}
|
|
36
|
+
.start-time .label-group .circle {
|
|
37
|
+
background-color: rgb(var(--color-green-default));
|
|
38
|
+
}
|
|
39
|
+
.end-time .label-group .circle {
|
|
40
|
+
background-color: rgb(var(--color-coral-default));
|
|
41
|
+
}
|
|
42
|
+
.label-group .line {
|
|
43
|
+
flex-grow: 1;
|
|
44
|
+
height: 0.25rem;
|
|
45
|
+
border-radius: 1rem;
|
|
46
|
+
}
|
|
47
|
+
.start-time .label-group .line {
|
|
48
|
+
background-image: linear-gradient(to right, rgb(var(--color-green-light)), rgb(var(--contrast-400)) 30%);
|
|
49
|
+
}
|
|
50
|
+
.end-time .label-group .line {
|
|
51
|
+
background-image: linear-gradient(to left, rgb(var(--color-coral-light)), rgb(var(--contrast-400)) 30%);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.date-pickers:has(> :last-child:nth-child(2)) .start-time .line {
|
|
55
|
+
margin-right: -0.5rem;
|
|
56
|
+
}
|
|
57
|
+
.date-pickers:has(> :last-child:nth-child(2)) .end-time .line {
|
|
58
|
+
margin-left: -0.5rem;
|
|
59
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
/**
|
|
3
|
+
* This component can receive one or two date values,
|
|
4
|
+
* and display them in a nice responsive layout, using date pickers.
|
|
5
|
+
*
|
|
6
|
+
* :::note
|
|
7
|
+
* The component needs to be provided at least with one value as
|
|
8
|
+
* `startTime` or `endTime` to get rendered correctly.
|
|
9
|
+
* :::
|
|
10
|
+
*
|
|
11
|
+
* The most common use case is to visualize a range for an event
|
|
12
|
+
* that has a start and end time.
|
|
13
|
+
*
|
|
14
|
+
* The end user can use the date pickers displayed in the UI,
|
|
15
|
+
* to change the start and end time. When these values are changed
|
|
16
|
+
* by the user, the component emits events.
|
|
17
|
+
*
|
|
18
|
+
* @exampleComponent limebb-example-date-range
|
|
19
|
+
*/
|
|
20
|
+
export class DateRange {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.handleStartTimeChange = (event) => {
|
|
23
|
+
event.stopPropagation();
|
|
24
|
+
this.changeStartTime.emit(event.detail);
|
|
25
|
+
};
|
|
26
|
+
this.handleEndTimeChange = (event) => {
|
|
27
|
+
event.stopPropagation();
|
|
28
|
+
this.changeEndTime.emit(event.detail);
|
|
29
|
+
};
|
|
30
|
+
this.startTime = undefined;
|
|
31
|
+
this.endTime = undefined;
|
|
32
|
+
this.startTimeLabel = undefined;
|
|
33
|
+
this.endTimeLabel = undefined;
|
|
34
|
+
this.language = undefined;
|
|
35
|
+
this.timeFormat = undefined;
|
|
36
|
+
this.type = undefined;
|
|
37
|
+
}
|
|
38
|
+
componentWillLoad() {
|
|
39
|
+
this.originalStartTime = this.startTime;
|
|
40
|
+
this.originalEndTime = this.endTime;
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
return (h("div", { class: "date-pickers" }, this.renderStartDatePicker(), this.renderEndDatePicker()));
|
|
44
|
+
}
|
|
45
|
+
renderStartDatePicker() {
|
|
46
|
+
if (!this.originalStartTime) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
return (h("div", { class: "start-time" }, this.renderDatePicker(this.startTimeLabel, this.startTime, !this.startTime, this.handleStartTimeChange)));
|
|
50
|
+
}
|
|
51
|
+
renderEndDatePicker() {
|
|
52
|
+
if (!this.originalEndTime) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
return (h("div", { class: "end-time" }, this.renderDatePicker(this.endTimeLabel, this.endTime, !this.endTime, this.handleEndTimeChange)));
|
|
56
|
+
}
|
|
57
|
+
renderDatePicker(label, value, isInvalid, onChangeHandler) {
|
|
58
|
+
return [
|
|
59
|
+
h("div", { class: "label-group" }, h("span", { class: "circle" }), h("span", { class: "label" }, label), h("span", { class: "line" })),
|
|
60
|
+
h("limel-date-picker", { type: this.type, value: value, format: this.timeFormat, language: this.language, onChange: onChangeHandler, invalid: isInvalid }),
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
static get is() { return "limebb-date-range"; }
|
|
64
|
+
static get encapsulation() { return "shadow"; }
|
|
65
|
+
static get originalStyleUrls() {
|
|
66
|
+
return {
|
|
67
|
+
"$": ["date-range.scss"]
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
static get styleUrls() {
|
|
71
|
+
return {
|
|
72
|
+
"$": ["date-range.css"]
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
static get properties() {
|
|
76
|
+
return {
|
|
77
|
+
"startTime": {
|
|
78
|
+
"type": "unknown",
|
|
79
|
+
"mutable": false,
|
|
80
|
+
"complexType": {
|
|
81
|
+
"original": "Date",
|
|
82
|
+
"resolved": "Date | undefined",
|
|
83
|
+
"references": {
|
|
84
|
+
"Date": {
|
|
85
|
+
"location": "global"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"required": false,
|
|
90
|
+
"optional": true,
|
|
91
|
+
"docs": {
|
|
92
|
+
"tags": [],
|
|
93
|
+
"text": "The start time"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"endTime": {
|
|
97
|
+
"type": "unknown",
|
|
98
|
+
"mutable": false,
|
|
99
|
+
"complexType": {
|
|
100
|
+
"original": "Date",
|
|
101
|
+
"resolved": "Date | undefined",
|
|
102
|
+
"references": {
|
|
103
|
+
"Date": {
|
|
104
|
+
"location": "global"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"required": false,
|
|
109
|
+
"optional": true,
|
|
110
|
+
"docs": {
|
|
111
|
+
"tags": [],
|
|
112
|
+
"text": "A secondary optional time, which is the time when an event ends."
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"startTimeLabel": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"mutable": false,
|
|
118
|
+
"complexType": {
|
|
119
|
+
"original": "string",
|
|
120
|
+
"resolved": "string | undefined",
|
|
121
|
+
"references": {}
|
|
122
|
+
},
|
|
123
|
+
"required": false,
|
|
124
|
+
"optional": true,
|
|
125
|
+
"docs": {
|
|
126
|
+
"tags": [],
|
|
127
|
+
"text": "The label that appears together with the date picker of `startTime`"
|
|
128
|
+
},
|
|
129
|
+
"attribute": "start-time-label",
|
|
130
|
+
"reflect": false
|
|
131
|
+
},
|
|
132
|
+
"endTimeLabel": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"mutable": false,
|
|
135
|
+
"complexType": {
|
|
136
|
+
"original": "string",
|
|
137
|
+
"resolved": "string | undefined",
|
|
138
|
+
"references": {}
|
|
139
|
+
},
|
|
140
|
+
"required": false,
|
|
141
|
+
"optional": true,
|
|
142
|
+
"docs": {
|
|
143
|
+
"tags": [],
|
|
144
|
+
"text": "The label that appears together with the date picker of `endTime`"
|
|
145
|
+
},
|
|
146
|
+
"attribute": "end-time-label",
|
|
147
|
+
"reflect": false
|
|
148
|
+
},
|
|
149
|
+
"language": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"mutable": false,
|
|
152
|
+
"complexType": {
|
|
153
|
+
"original": "Languages",
|
|
154
|
+
"resolved": "\"da\" | \"de\" | \"en\" | \"fi\" | \"fr\" | \"nb\" | \"nl\" | \"no\" | \"sv\"",
|
|
155
|
+
"references": {
|
|
156
|
+
"Languages": {
|
|
157
|
+
"location": "import",
|
|
158
|
+
"path": "@limetech/lime-elements"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"required": false,
|
|
163
|
+
"optional": false,
|
|
164
|
+
"docs": {
|
|
165
|
+
"tags": [],
|
|
166
|
+
"text": "Defines the localization for translations and date formatting"
|
|
167
|
+
},
|
|
168
|
+
"attribute": "language",
|
|
169
|
+
"reflect": false
|
|
170
|
+
},
|
|
171
|
+
"timeFormat": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"mutable": false,
|
|
174
|
+
"complexType": {
|
|
175
|
+
"original": "string",
|
|
176
|
+
"resolved": "string",
|
|
177
|
+
"references": {}
|
|
178
|
+
},
|
|
179
|
+
"required": false,
|
|
180
|
+
"optional": false,
|
|
181
|
+
"docs": {
|
|
182
|
+
"tags": [],
|
|
183
|
+
"text": "Format to display the selected date in"
|
|
184
|
+
},
|
|
185
|
+
"attribute": "time-format",
|
|
186
|
+
"reflect": false
|
|
187
|
+
},
|
|
188
|
+
"type": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"mutable": false,
|
|
191
|
+
"complexType": {
|
|
192
|
+
"original": "DateType",
|
|
193
|
+
"resolved": "\"date\" | \"datetime\" | \"month\" | \"quarter\" | \"time\" | \"week\" | \"year\"",
|
|
194
|
+
"references": {
|
|
195
|
+
"DateType": {
|
|
196
|
+
"location": "import",
|
|
197
|
+
"path": "@limetech/lime-elements"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"required": false,
|
|
202
|
+
"optional": false,
|
|
203
|
+
"docs": {
|
|
204
|
+
"tags": [],
|
|
205
|
+
"text": "Type of date picker.\nThe type can be \"date\" | \"datetime\" | \"month\" | \"quarter\" | \"time\" | \"week\" | \"year\""
|
|
206
|
+
},
|
|
207
|
+
"attribute": "type",
|
|
208
|
+
"reflect": false
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
static get events() {
|
|
213
|
+
return [{
|
|
214
|
+
"method": "changeStartTime",
|
|
215
|
+
"name": "changeStartTime",
|
|
216
|
+
"bubbles": true,
|
|
217
|
+
"cancelable": true,
|
|
218
|
+
"composed": true,
|
|
219
|
+
"docs": {
|
|
220
|
+
"tags": [],
|
|
221
|
+
"text": "Emitted when the start time value has changed by the end user,\nusing the date pickers in the UI."
|
|
222
|
+
},
|
|
223
|
+
"complexType": {
|
|
224
|
+
"original": "Date",
|
|
225
|
+
"resolved": "Date",
|
|
226
|
+
"references": {
|
|
227
|
+
"Date": {
|
|
228
|
+
"location": "global"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}, {
|
|
233
|
+
"method": "changeEndTime",
|
|
234
|
+
"name": "changeEndTime",
|
|
235
|
+
"bubbles": true,
|
|
236
|
+
"cancelable": true,
|
|
237
|
+
"composed": true,
|
|
238
|
+
"docs": {
|
|
239
|
+
"tags": [],
|
|
240
|
+
"text": "Emitted when the end time value has changed by the end user,\nusing the date pickers in the UI."
|
|
241
|
+
},
|
|
242
|
+
"complexType": {
|
|
243
|
+
"original": "Date",
|
|
244
|
+
"resolved": "Date",
|
|
245
|
+
"references": {
|
|
246
|
+
"Date": {
|
|
247
|
+
"location": "global"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}];
|
|
252
|
+
}
|
|
253
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
:host(limebb-example-date-range) {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
background-color: rgb(var(--contrast-500));
|
|
5
|
+
border-radius: 0.5rem;
|
|
6
|
+
padding: 0.5rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
span {
|
|
10
|
+
padding-left: 0.5rem;
|
|
11
|
+
font-size: 1.25rem;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
limebb-date-range {
|
|
15
|
+
margin-top: 0.75rem;
|
|
16
|
+
border-radius: 0.75rem;
|
|
17
|
+
background-color: rgb(var(--contrast-100));
|
|
18
|
+
}
|
|
19
|
+
limebb-date-range:before {
|
|
20
|
+
content: "";
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: -0.5rem;
|
|
23
|
+
left: 2rem;
|
|
24
|
+
background-color: inherit;
|
|
25
|
+
width: 1rem;
|
|
26
|
+
height: 1rem;
|
|
27
|
+
rotate: 45deg;
|
|
28
|
+
border-radius: 0.25rem 0 0 0;
|
|
29
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
/**
|
|
3
|
+
* Basic example
|
|
4
|
+
*/
|
|
5
|
+
export class DateRangeExample {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.startTime = new Date('2022-01-02T00:00:00.000Z');
|
|
8
|
+
this.endTime = new Date('2022-01-03T00:00:00.000Z');
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
return [
|
|
12
|
+
h("span", null, "My event"),
|
|
13
|
+
h("limebb-date-range", { startTime: this.startTime, endTime: this.endTime, startTimeLabel: "Start time", endTimeLabel: "End time", type: "datetime" }),
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
static get is() { return "limebb-example-date-range"; }
|
|
17
|
+
static get encapsulation() { return "shadow"; }
|
|
18
|
+
static get originalStyleUrls() {
|
|
19
|
+
return {
|
|
20
|
+
"$": ["date-range.scss"]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
static get styleUrls() {
|
|
24
|
+
return {
|
|
25
|
+
"$": ["date-range.css"]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|