@paperless/core 1.54.4 → 1.55.1
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/CHANGELOG.md +23 -0
- package/dist/build/{p-bf1ffb6a.entry.js → p-0695e7ef.entry.js} +2 -2
- package/dist/build/p-0695e7ef.entry.js.map +1 -0
- package/dist/build/{p-be4c976c.entry.js → p-2b4bdcd9.entry.js} +2 -2
- package/dist/build/p-2b4bdcd9.entry.js.map +1 -0
- package/dist/build/p-3755da14.entry.js +2 -0
- package/dist/build/p-3755da14.entry.js.map +1 -0
- package/dist/build/{p-4e9e4ce2.entry.js → p-639665b1.entry.js} +2 -2
- package/dist/{paperless/p-4e9e4ce2.entry.js.map → build/p-639665b1.entry.js.map} +1 -1
- package/dist/{paperless/p-52893b09.entry.js → build/p-95dc4bd3.entry.js} +2 -2
- package/dist/build/p-95dc4bd3.entry.js.map +1 -0
- package/dist/build/p-c3999d3e.entry.js +2 -0
- package/dist/build/p-c3999d3e.entry.js.map +1 -0
- package/dist/build/paperless.esm.js +1 -1
- package/dist/build/paperless.esm.js.map +1 -1
- package/dist/cjs/index-1fde8b14.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/p-backdrop.cjs.entry.js +1 -1
- package/dist/cjs/p-backdrop.cjs.entry.js.map +1 -1
- package/dist/cjs/p-button-group.cjs.entry.js +45 -0
- package/dist/cjs/p-button-group.cjs.entry.js.map +1 -0
- package/dist/cjs/p-button_3.cjs.entry.js +4 -2
- package/dist/cjs/p-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/p-datepicker.cjs.entry.js +8 -7
- package/dist/cjs/p-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/p-drawer-body_3.cjs.entry.js +1 -1
- package/dist/cjs/p-drawer-body_3.cjs.entry.js.map +1 -1
- package/dist/cjs/p-modal-body_4.cjs.entry.js +1 -1
- package/dist/cjs/p-modal-body_4.cjs.entry.js.map +1 -1
- package/dist/cjs/paperless.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/atoms/backdrop/backdrop.component.css +1 -1
- package/dist/collection/components/atoms/button/button.component.css +1 -1
- package/dist/collection/components/atoms/button/button.component.js +21 -1
- package/dist/collection/components/atoms/button/button.component.js.map +1 -1
- package/dist/collection/components/atoms/drawer-header/drawer-header.component.css +1 -1
- package/dist/collection/components/atoms/modal-container/modal-container.component.css +1 -1
- package/dist/collection/components/molecules/button-group/button-group.component.js +69 -0
- package/dist/collection/components/molecules/button-group/button-group.component.js.map +1 -0
- package/dist/collection/components/molecules/button-group/test/button-group.component.e2e.js +26 -0
- package/dist/collection/components/molecules/button-group/test/button-group.component.e2e.js.map +1 -0
- package/dist/collection/components/molecules/button-group/test/button-group.component.spec.js +35 -0
- package/dist/collection/components/molecules/button-group/test/button-group.component.spec.js.map +1 -0
- package/dist/collection/components/molecules/datepicker/datepicker.component.css +1 -1
- package/dist/collection/components/molecules/datepicker/datepicker.component.js +55 -6
- package/dist/collection/components/molecules/datepicker/datepicker.component.js.map +1 -1
- package/dist/components/backdrop.component.js +1 -1
- package/dist/components/backdrop.component.js.map +1 -1
- package/dist/components/button.component.js +6 -3
- package/dist/components/button.component.js.map +1 -1
- package/dist/components/drawer-header.component.js +1 -1
- package/dist/components/drawer-header.component.js.map +1 -1
- package/dist/components/modal-container.component.js +1 -1
- package/dist/components/modal-container.component.js.map +1 -1
- package/dist/components/p-button-group.d.ts +11 -0
- package/dist/components/p-button-group.js +61 -0
- package/dist/components/p-button-group.js.map +1 -0
- package/dist/components/p-datepicker.js +10 -7
- package/dist/components/p-datepicker.js.map +1 -1
- package/dist/esm/index-7b917f6b.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/p-backdrop.entry.js +1 -1
- package/dist/esm/p-backdrop.entry.js.map +1 -1
- package/dist/esm/p-button-group.entry.js +41 -0
- package/dist/esm/p-button-group.entry.js.map +1 -0
- package/dist/esm/p-button_3.entry.js +4 -2
- package/dist/esm/p-button_3.entry.js.map +1 -1
- package/dist/esm/p-datepicker.entry.js +8 -7
- package/dist/esm/p-datepicker.entry.js.map +1 -1
- package/dist/esm/p-drawer-body_3.entry.js +1 -1
- package/dist/esm/p-drawer-body_3.entry.js.map +1 -1
- package/dist/esm/p-modal-body_4.entry.js +1 -1
- package/dist/esm/p-modal-body_4.entry.js.map +1 -1
- package/dist/esm/paperless.js +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/{p-bf1ffb6a.entry.js → p-0695e7ef.entry.js} +2 -2
- package/dist/paperless/p-0695e7ef.entry.js.map +1 -0
- package/dist/paperless/{p-be4c976c.entry.js → p-2b4bdcd9.entry.js} +2 -2
- package/dist/paperless/p-2b4bdcd9.entry.js.map +1 -0
- package/dist/paperless/p-3755da14.entry.js +2 -0
- package/dist/paperless/p-3755da14.entry.js.map +1 -0
- package/dist/paperless/{p-4e9e4ce2.entry.js → p-639665b1.entry.js} +2 -2
- package/dist/{build/p-4e9e4ce2.entry.js.map → paperless/p-639665b1.entry.js.map} +1 -1
- package/dist/{build/p-52893b09.entry.js → paperless/p-95dc4bd3.entry.js} +2 -2
- package/dist/paperless/p-95dc4bd3.entry.js.map +1 -0
- package/dist/paperless/p-c3999d3e.entry.js +2 -0
- package/dist/paperless/p-c3999d3e.entry.js.map +1 -0
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/paperless/paperless.esm.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/types/components/atoms/button/button.component.d.ts +4 -0
- package/dist/types/components/molecules/button-group/button-group.component.d.ts +14 -0
- package/dist/types/components/molecules/datepicker/datepicker.component.d.ts +9 -0
- package/dist/types/components.d.ts +45 -0
- package/hydrate/index.js +67 -14
- package/package.json +1 -1
- package/dist/build/p-52893b09.entry.js.map +0 -1
- package/dist/build/p-b848c222.entry.js +0 -2
- package/dist/build/p-b848c222.entry.js.map +0 -1
- package/dist/build/p-be4c976c.entry.js.map +0 -1
- package/dist/build/p-bf1ffb6a.entry.js.map +0 -1
- package/dist/paperless/p-52893b09.entry.js.map +0 -1
- package/dist/paperless/p-b848c222.entry.js +0 -2
- package/dist/paperless/p-b848c222.entry.js.map +0 -1
- package/dist/paperless/p-be4c976c.entry.js.map +0 -1
- package/dist/paperless/p-bf1ffb6a.entry.js.map +0 -1
|
@@ -25,6 +25,8 @@ export class Datepicker {
|
|
|
25
25
|
this.required = undefined;
|
|
26
26
|
this.error = undefined;
|
|
27
27
|
this.disabled = false;
|
|
28
|
+
this.strategy = 'absolute';
|
|
29
|
+
this.placement = 'bottom-start';
|
|
28
30
|
this._showDropdown = false;
|
|
29
31
|
this._value = undefined;
|
|
30
32
|
this._minDate = undefined;
|
|
@@ -73,13 +75,13 @@ export class Datepicker {
|
|
|
73
75
|
}
|
|
74
76
|
// normalize all to date
|
|
75
77
|
this._disabledDates = disabledDates
|
|
76
|
-
.map(
|
|
78
|
+
.map(date => {
|
|
77
79
|
if (typeof date === 'string') {
|
|
78
80
|
return new Date(date);
|
|
79
81
|
}
|
|
80
82
|
return date;
|
|
81
83
|
})
|
|
82
|
-
.filter(
|
|
84
|
+
.filter(date => isValid(date));
|
|
83
85
|
if (this._isDisabledDay(this._value)) {
|
|
84
86
|
this._setValue(null);
|
|
85
87
|
}
|
|
@@ -94,14 +96,13 @@ export class Datepicker {
|
|
|
94
96
|
if (this.maxDate) {
|
|
95
97
|
this.parseMaxDate(this.maxDate);
|
|
96
98
|
}
|
|
97
|
-
if (this.mode !== 'day' &&
|
|
98
|
-
this.format === this._defaultFormats['day']) {
|
|
99
|
+
if (this.mode !== 'day' && this.format === this._defaultFormats['day']) {
|
|
99
100
|
this.format = this._defaultFormats[this.mode];
|
|
100
101
|
}
|
|
101
102
|
this.parseValue(this.value);
|
|
102
103
|
}
|
|
103
104
|
render() {
|
|
104
|
-
return (h(Host, { class:
|
|
105
|
+
return (h(Host, { class: 'p-datepicker' }, h("p-dropdown", { strategy: this.strategy, placement: this.placement, disableTriggerClick: true, applyMaxWidth: false, applyFullWidth: false, insideClick: true, show: this._showDropdown }, h("p-input-group", { slot: 'trigger', icon: this.hideIconWhenFilled && !!this._value ? null : 'calendar', iconPosition: 'start', size: this.size, prefix: this.prefix, label: this.label, helper: this.helper, required: this.required, error: this.error, disabled: this.disabled, focused: this._showDropdown }, h("input", { slot: 'input', type: 'text', placeholder: this.placeholder, value: this._getFormattedDate(), class: 'p-input cursor-pointer', onFocus: () => this._onFocus(), onBlur: ev => this._onBlur(ev), onInput: ev => this._onInput(ev) })), h("div", { slot: 'items' }, h("p-calendar", { variant: 'embedded', value: this._value, onValueChange: ({ detail }) => (this.value = detail), preselectToday: this.preselectToday, disabledDates: this.disabledDates, minDate: this.minDate, maxDate: this.maxDate, disableWeekends: this.disableWeekends, mode: this.mode })))));
|
|
105
106
|
}
|
|
106
107
|
documentClickHandler({ target }) {
|
|
107
108
|
if (!this._showDropdown || childOf(target, this._el)) {
|
|
@@ -161,7 +162,7 @@ export class Datepicker {
|
|
|
161
162
|
_isDisabledDay(day) {
|
|
162
163
|
return ((isBefore(day, this._minDate) && !isSameDay(day, this._minDate)) ||
|
|
163
164
|
(isAfter(day, this._maxDate) && !isSameDay(day, this._maxDate)) ||
|
|
164
|
-
this._disabledDates.findIndex(
|
|
165
|
+
this._disabledDates.findIndex(date => isSameDay(date, day)) >= 0);
|
|
165
166
|
}
|
|
166
167
|
_getFormattedDate() {
|
|
167
168
|
if (!this._value) {
|
|
@@ -501,6 +502,54 @@ export class Datepicker {
|
|
|
501
502
|
"attribute": "disabled",
|
|
502
503
|
"reflect": true,
|
|
503
504
|
"defaultValue": "false"
|
|
505
|
+
},
|
|
506
|
+
"strategy": {
|
|
507
|
+
"type": "string",
|
|
508
|
+
"mutable": false,
|
|
509
|
+
"complexType": {
|
|
510
|
+
"original": "Strategy",
|
|
511
|
+
"resolved": "\"absolute\" | \"fixed\"",
|
|
512
|
+
"references": {
|
|
513
|
+
"Strategy": {
|
|
514
|
+
"location": "import",
|
|
515
|
+
"path": "@floating-ui/dom",
|
|
516
|
+
"id": "../../node_modules/@floating-ui/dom/index.d.ts::Strategy"
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
"required": false,
|
|
521
|
+
"optional": false,
|
|
522
|
+
"docs": {
|
|
523
|
+
"tags": [],
|
|
524
|
+
"text": "The strategy of the dropdown placement"
|
|
525
|
+
},
|
|
526
|
+
"attribute": "strategy",
|
|
527
|
+
"reflect": false,
|
|
528
|
+
"defaultValue": "'absolute'"
|
|
529
|
+
},
|
|
530
|
+
"placement": {
|
|
531
|
+
"type": "string",
|
|
532
|
+
"mutable": false,
|
|
533
|
+
"complexType": {
|
|
534
|
+
"original": "Placement",
|
|
535
|
+
"resolved": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
|
|
536
|
+
"references": {
|
|
537
|
+
"Placement": {
|
|
538
|
+
"location": "import",
|
|
539
|
+
"path": "@floating-ui/dom",
|
|
540
|
+
"id": "../../node_modules/@floating-ui/dom/index.d.ts::Placement"
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
"required": false,
|
|
545
|
+
"optional": false,
|
|
546
|
+
"docs": {
|
|
547
|
+
"tags": [],
|
|
548
|
+
"text": "The placement of the dropdown"
|
|
549
|
+
},
|
|
550
|
+
"attribute": "placement",
|
|
551
|
+
"reflect": true,
|
|
552
|
+
"defaultValue": "'bottom-start'"
|
|
504
553
|
}
|
|
505
554
|
};
|
|
506
555
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datepicker.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/datepicker/datepicker.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,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n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport {\n\tformat,\n\tisAfter,\n\tisBefore,\n\tisSameDay,\n\tisValid,\n\tparse,\n\tstartOfDay,\n} from 'date-fns';\nimport { childOf } from '../../../utils';\n\n@Component({\n\ttag: 'p-datepicker',\n\tstyleUrl: 'datepicker.component.scss',\n\tshadow: false,\n})\nexport class Datepicker {\n\t/**\n\t * The placeholder of the input\n\t */\n\t@Prop() placeholder: string;\n\n\t/**\n\t * The current value\n\t */\n\t@Prop() value: Date | string | null | undefined;\n\n\t/**\n\t * Wethter to automatically preselect today\n\t */\n\t@Prop() preselectToday: boolean = false;\n\n\t/**\n\t * Disabled dates\n\t */\n\t@Prop() disabledDates?: Array<Date | string> | string;\n\n\t/**\n\t * Min date\n\t */\n\t@Prop() minDate?: Date | string;\n\n\t/**\n\t * Max date\n\t */\n\t@Prop() maxDate?: Date | string;\n\n\t/**\n\t * Wether to disable the weekends\n\t */\n\t@Prop() disableWeekends: boolean = false;\n\n\t/**\n\t * The mode of the datepicker\n\t */\n\t@Prop() mode: 'year' | 'month' | 'day' = 'day';\n\n\t/**\n\t * Event when the value changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tvalueChange: EventEmitter<any>;\n\n\t/**\n\t * The display & parse format to use\n\t */\n\t@Prop() format: string = 'dd-MM-yyyy';\n\n /**\n * Hides the icon when filled\n */\n @Prop() hideIconWhenFilled: boolean = false;\n\n\t/**\n\t * The size of the input group used by the datepicker\n\t */\n\t@Prop() size: 'small' | 'medium' = 'medium';\n\n\n\t/**\n\t * The prefix of the input group used by the datepicker\n\t */\n\t@Prop() prefix: string;\n\n\t/**\n\t * The label of the input group used by the datepicker\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * The helper of the input group used by the datepicker\n\t */\n\t@Prop() helper: string;\n\n\t/**\n\t * Wether the field is required\n\t */\n\t@Prop({ reflect: true }) required: boolean;\n\n\t/**\n\t * The helper of the input group used by the datepicker\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * Wether the input group is disabled used by the datepicker\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _showDropdown: any = false;\n\t@State() private _value: Date;\n\t@State() private _minDate: Date;\n\t@State() private _maxDate: Date;\n\t@State() private _disabledDates: Date[] = [];\n\n\tprivate _onInputTimeout: NodeJS.Timeout;\n\n\tprivate _defaultFormats = {\n\t\tyear: 'yyyy',\n\t\tmonth: 'LLLL, yyyy',\n\t\tday: 'dd-MM-yyyy',\n\t};\n\n\t@Watch('value')\n\tprotected parseValue(value: string | Date) {\n\t\tif (!value && this.preselectToday) {\n\t\t\tvalue = new Date();\n\t\t}\n\n\t\tif (typeof value === 'string') {\n\t\t\tvalue = new Date(value);\n\t\t}\n\n\t\tthis._setValue(value);\n\t}\n\n\t@Watch('minDate')\n\tprotected parseMinDate(minDate: string | Date) {\n\t\tif (typeof minDate === 'string') {\n\t\t\tminDate = new Date(minDate);\n\t\t}\n\n\t\tif (!isValid(minDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._minDate = minDate;\n\n\t\tif (isBefore(this._value, this._minDate)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\t@Watch('maxDate')\n\tprotected parseMaxDate(maxDate: string | Date) {\n\t\tif (typeof maxDate === 'string') {\n\t\t\tmaxDate = new Date(maxDate);\n\t\t}\n\n\t\tif (!isValid(maxDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._maxDate = maxDate;\n\n\t\tif (isAfter(this._value, this._maxDate)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\t@Watch('disabledDates')\n\tprotected parseDisabledDates(disabledDates: Array<string | Date> | string) {\n\t\tif (typeof disabledDates === 'string') {\n\t\t\tdisabledDates = JSON.parse(disabledDates);\n\t\t}\n\n\t\tif (!disabledDates || !Array.isArray(disabledDates)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// normalize all to date\n\t\tthis._disabledDates = disabledDates\n\t\t\t.map((date) => {\n\t\t\t\tif (typeof date === 'string') {\n\t\t\t\t\treturn new Date(date);\n\t\t\t\t}\n\n\t\t\t\treturn date;\n\t\t\t})\n\t\t\t.filter((date) => isValid(date));\n\n\t\tif (this._isDisabledDay(this._value)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\tcomponentWillLoad() {\n\t\tif (this.disabledDates) {\n\t\t\tthis.parseDisabledDates(this.disabledDates);\n\t\t}\n\n\t\tif (this.minDate) {\n\t\t\tthis.parseMinDate(this.minDate);\n\t\t}\n\n\t\tif (this.maxDate) {\n\t\t\tthis.parseMaxDate(this.maxDate);\n\t\t}\n\n\t\tif (\n\t\t\tthis.mode !== 'day' &&\n\t\t\tthis.format === this._defaultFormats['day']\n\t\t) {\n\t\t\tthis.format = this._defaultFormats[this.mode];\n\t\t}\n\n\t\tthis.parseValue(this.value);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-datepicker\">\n\t\t\t\t<p-dropdown\n\t\t\t\t\tdisableTriggerClick={true}\n\t\t\t\t\tapplyMaxWidth={false}\n\t\t\t\t\tapplyFullWidth={false}\n\t\t\t\t\tinsideClick={true}\n\t\t\t\t\tshow={this._showDropdown}\n\t\t\t\t>\n\t\t\t\t\t<p-input-group\n\t\t\t\t\t\tslot=\"trigger\"\n\t\t\t\t\t\ticon={this.hideIconWhenFilled && !!this._value ? null : 'calendar'}\n\t\t\t\t\t\ticonPosition=\"start\"\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\tprefix={this.prefix}\n\t\t\t\t\t\tlabel={this.label}\n\t\t\t\t\t\thelper={this.helper}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\terror={this.error}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tfocused={this._showDropdown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tslot=\"input\"\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\t\tvalue={this._getFormattedDate()}\n\t\t\t\t\t\t\tclass=\"p-input cursor-pointer\"\n\t\t\t\t\t\t\tonFocus={() => this._onFocus()}\n\t\t\t\t\t\t\tonBlur={(ev) => this._onBlur(ev)}\n\t\t\t\t\t\t\tonInput={(ev) => this._onInput(ev)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</p-input-group>\n\t\t\t\t\t<div slot=\"items\">\n\t\t\t\t\t\t<p-calendar\n\t\t\t\t\t\t\tvariant=\"embedded\"\n\t\t\t\t\t\t\tvalue={this._value}\n\t\t\t\t\t\t\tonValueChange={({ detail }) =>\n\t\t\t\t\t\t\t\t(this.value = detail)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tpreselectToday={this.preselectToday}\n\t\t\t\t\t\t\tdisabledDates={this.disabledDates}\n\t\t\t\t\t\t\tminDate={this.minDate}\n\t\t\t\t\t\t\tmaxDate={this.maxDate}\n\t\t\t\t\t\t\tdisableWeekends={this.disableWeekends}\n\t\t\t\t\t\t\tmode={this.mode}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</p-dropdown>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._showDropdown || childOf(target, this._el)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = false;\n\t}\n\n\tprivate _onFocus() {\n\t\tthis._showDropdown = true;\n\t}\n\n\tprivate _onBlur(ev) {\n\t\tif (ev.target.value === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst value = parse(ev.target.value, this.format, new Date());\n\n\t\tif (!isValid(value) || this._isDisabledDay(value)) {\n\t\t\tev.target.value = this._getFormattedDate();\n\t\t\treturn;\n\t\t}\n\t}\n\n\tprivate _onInput(ev) {\n\t\tif (this._onInputTimeout) {\n\t\t\tclearTimeout(this._onInputTimeout);\n\t\t\tthis._onInputTimeout = null;\n\t\t}\n\n\t\tthis._onInputTimeout = setTimeout(() => {\n\t\t\tconst value = parse(ev.target.value, this.format, new Date());\n\t\t\tif (!isValid(value)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._setValue(value, false);\n\t\t}, 250);\n\t}\n\n\tprivate _setValue(value: Date | null, hideDropdown = true) {\n\t\tif (value === null) {\n\t\t\tthis._value = null;\n\t\t\tthis.valueChange.emit(null);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isValid(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isDisabledDay(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tvalue = startOfDay(value);\n\t\tconst isSameValue = isSameDay(value, this._value);\n\n\t\tif (isSameValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (hideDropdown) {\n\t\t\tthis._showDropdown = false;\n\t\t}\n\n\t\tthis._value = value;\n\t\tthis.valueChange.emit(value);\n\t}\n\n\tprivate _isDisabledDay(day: Date) {\n\t\treturn (\n\t\t\t(isBefore(day, this._minDate) && !isSameDay(day, this._minDate)) ||\n\t\t\t(isAfter(day, this._maxDate) && !isSameDay(day, this._maxDate)) ||\n\t\t\tthis._disabledDates.findIndex((date) => isSameDay(date, day)) >= 0\n\t\t);\n\t}\n\n\tprivate _getFormattedDate() {\n\t\tif (!this._value) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn format(this._value, this.format);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"datepicker.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/datepicker/datepicker.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,MAAM,EACN,OAAO,EACP,QAAQ,E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\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport {\n\tformat,\n\tisAfter,\n\tisBefore,\n\tisSameDay,\n\tisValid,\n\tparse,\n\tstartOfDay,\n} from 'date-fns';\nimport { childOf } from '../../../utils';\nimport { Placement, Strategy } from '@floating-ui/dom';\n\n@Component({\n\ttag: 'p-datepicker',\n\tstyleUrl: 'datepicker.component.scss',\n\tshadow: false,\n})\nexport class Datepicker {\n\t/**\n\t * The placeholder of the input\n\t */\n\t@Prop() placeholder: string;\n\n\t/**\n\t * The current value\n\t */\n\t@Prop() value: Date | string | null | undefined;\n\n\t/**\n\t * Wethter to automatically preselect today\n\t */\n\t@Prop() preselectToday: boolean = false;\n\n\t/**\n\t * Disabled dates\n\t */\n\t@Prop() disabledDates?: Array<Date | string> | string;\n\n\t/**\n\t * Min date\n\t */\n\t@Prop() minDate?: Date | string;\n\n\t/**\n\t * Max date\n\t */\n\t@Prop() maxDate?: Date | string;\n\n\t/**\n\t * Wether to disable the weekends\n\t */\n\t@Prop() disableWeekends: boolean = false;\n\n\t/**\n\t * The mode of the datepicker\n\t */\n\t@Prop() mode: 'year' | 'month' | 'day' = 'day';\n\n\t/**\n\t * Event when the value changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tvalueChange: EventEmitter<any>;\n\n\t/**\n\t * The display & parse format to use\n\t */\n\t@Prop() format: string = 'dd-MM-yyyy';\n\n\t/**\n\t * Hides the icon when filled\n\t */\n\t@Prop() hideIconWhenFilled: boolean = false;\n\n\t/**\n\t * The size of the input group used by the datepicker\n\t */\n\t@Prop() size: 'small' | 'medium' = 'medium';\n\n\t/**\n\t * The prefix of the input group used by the datepicker\n\t */\n\t@Prop() prefix: string;\n\n\t/**\n\t * The label of the input group used by the datepicker\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * The helper of the input group used by the datepicker\n\t */\n\t@Prop() helper: string;\n\n\t/**\n\t * Wether the field is required\n\t */\n\t@Prop({ reflect: true }) required: boolean;\n\n\t/**\n\t * The helper of the input group used by the datepicker\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * Wether the input group is disabled used by the datepicker\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * The strategy of the dropdown placement\n\t */\n\t@Prop() strategy: Strategy = 'absolute';\n\n\t/**\n\t * The placement of the dropdown\n\t */\n\t@Prop({ reflect: true }) placement: Placement = 'bottom-start';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _showDropdown: any = false;\n\t@State() private _value: Date;\n\t@State() private _minDate: Date;\n\t@State() private _maxDate: Date;\n\t@State() private _disabledDates: Date[] = [];\n\n\tprivate _onInputTimeout: NodeJS.Timeout;\n\n\tprivate _defaultFormats = {\n\t\tyear: 'yyyy',\n\t\tmonth: 'LLLL, yyyy',\n\t\tday: 'dd-MM-yyyy',\n\t};\n\n\t@Watch('value')\n\tprotected parseValue(value: string | Date) {\n\t\tif (!value && this.preselectToday) {\n\t\t\tvalue = new Date();\n\t\t}\n\n\t\tif (typeof value === 'string') {\n\t\t\tvalue = new Date(value);\n\t\t}\n\n\t\tthis._setValue(value);\n\t}\n\n\t@Watch('minDate')\n\tprotected parseMinDate(minDate: string | Date) {\n\t\tif (typeof minDate === 'string') {\n\t\t\tminDate = new Date(minDate);\n\t\t}\n\n\t\tif (!isValid(minDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._minDate = minDate;\n\n\t\tif (isBefore(this._value, this._minDate)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\t@Watch('maxDate')\n\tprotected parseMaxDate(maxDate: string | Date) {\n\t\tif (typeof maxDate === 'string') {\n\t\t\tmaxDate = new Date(maxDate);\n\t\t}\n\n\t\tif (!isValid(maxDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._maxDate = maxDate;\n\n\t\tif (isAfter(this._value, this._maxDate)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\t@Watch('disabledDates')\n\tprotected parseDisabledDates(disabledDates: Array<string | Date> | string) {\n\t\tif (typeof disabledDates === 'string') {\n\t\t\tdisabledDates = JSON.parse(disabledDates);\n\t\t}\n\n\t\tif (!disabledDates || !Array.isArray(disabledDates)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// normalize all to date\n\t\tthis._disabledDates = disabledDates\n\t\t\t.map(date => {\n\t\t\t\tif (typeof date === 'string') {\n\t\t\t\t\treturn new Date(date);\n\t\t\t\t}\n\n\t\t\t\treturn date;\n\t\t\t})\n\t\t\t.filter(date => isValid(date));\n\n\t\tif (this._isDisabledDay(this._value)) {\n\t\t\tthis._setValue(null);\n\t\t}\n\t}\n\n\tcomponentWillLoad() {\n\t\tif (this.disabledDates) {\n\t\t\tthis.parseDisabledDates(this.disabledDates);\n\t\t}\n\n\t\tif (this.minDate) {\n\t\t\tthis.parseMinDate(this.minDate);\n\t\t}\n\n\t\tif (this.maxDate) {\n\t\t\tthis.parseMaxDate(this.maxDate);\n\t\t}\n\n\t\tif (this.mode !== 'day' && this.format === this._defaultFormats['day']) {\n\t\t\tthis.format = this._defaultFormats[this.mode];\n\t\t}\n\n\t\tthis.parseValue(this.value);\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-datepicker'>\n\t\t\t\t<p-dropdown\n\t\t\t\t\tstrategy={this.strategy}\n\t\t\t\t\tplacement={this.placement}\n\t\t\t\t\tdisableTriggerClick={true}\n\t\t\t\t\tapplyMaxWidth={false}\n\t\t\t\t\tapplyFullWidth={false}\n\t\t\t\t\tinsideClick={true}\n\t\t\t\t\tshow={this._showDropdown}\n\t\t\t\t>\n\t\t\t\t\t<p-input-group\n\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\ticon={this.hideIconWhenFilled && !!this._value ? null : 'calendar'}\n\t\t\t\t\t\ticonPosition='start'\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\tprefix={this.prefix}\n\t\t\t\t\t\tlabel={this.label}\n\t\t\t\t\t\thelper={this.helper}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\terror={this.error}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tfocused={this._showDropdown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tslot='input'\n\t\t\t\t\t\t\ttype='text'\n\t\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\t\tvalue={this._getFormattedDate()}\n\t\t\t\t\t\t\tclass='p-input cursor-pointer'\n\t\t\t\t\t\t\tonFocus={() => this._onFocus()}\n\t\t\t\t\t\t\tonBlur={ev => this._onBlur(ev)}\n\t\t\t\t\t\t\tonInput={ev => this._onInput(ev)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</p-input-group>\n\t\t\t\t\t<div slot='items'>\n\t\t\t\t\t\t<p-calendar\n\t\t\t\t\t\t\tvariant='embedded'\n\t\t\t\t\t\t\tvalue={this._value}\n\t\t\t\t\t\t\tonValueChange={({ detail }) => (this.value = detail)}\n\t\t\t\t\t\t\tpreselectToday={this.preselectToday}\n\t\t\t\t\t\t\tdisabledDates={this.disabledDates}\n\t\t\t\t\t\t\tminDate={this.minDate}\n\t\t\t\t\t\t\tmaxDate={this.maxDate}\n\t\t\t\t\t\t\tdisableWeekends={this.disableWeekends}\n\t\t\t\t\t\t\tmode={this.mode}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</p-dropdown>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._showDropdown || childOf(target, this._el)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = false;\n\t}\n\n\tprivate _onFocus() {\n\t\tthis._showDropdown = true;\n\t}\n\n\tprivate _onBlur(ev) {\n\t\tif (ev.target.value === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst value = parse(ev.target.value, this.format, new Date());\n\n\t\tif (!isValid(value) || this._isDisabledDay(value)) {\n\t\t\tev.target.value = this._getFormattedDate();\n\t\t\treturn;\n\t\t}\n\t}\n\n\tprivate _onInput(ev) {\n\t\tif (this._onInputTimeout) {\n\t\t\tclearTimeout(this._onInputTimeout);\n\t\t\tthis._onInputTimeout = null;\n\t\t}\n\n\t\tthis._onInputTimeout = setTimeout(() => {\n\t\t\tconst value = parse(ev.target.value, this.format, new Date());\n\t\t\tif (!isValid(value)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._setValue(value, false);\n\t\t}, 250);\n\t}\n\n\tprivate _setValue(value: Date | null, hideDropdown = true) {\n\t\tif (value === null) {\n\t\t\tthis._value = null;\n\t\t\tthis.valueChange.emit(null);\n\t\t\treturn;\n\t\t}\n\n\t\tif (!isValid(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._isDisabledDay(value)) {\n\t\t\treturn;\n\t\t}\n\n\t\tvalue = startOfDay(value);\n\t\tconst isSameValue = isSameDay(value, this._value);\n\n\t\tif (isSameValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (hideDropdown) {\n\t\t\tthis._showDropdown = false;\n\t\t}\n\n\t\tthis._value = value;\n\t\tthis.valueChange.emit(value);\n\t}\n\n\tprivate _isDisabledDay(day: Date) {\n\t\treturn (\n\t\t\t(isBefore(day, this._minDate) && !isSameDay(day, this._minDate)) ||\n\t\t\t(isAfter(day, this._maxDate) && !isSameDay(day, this._maxDate)) ||\n\t\t\tthis._disabledDates.findIndex(date => isSameDay(date, day)) >= 0\n\t\t);\n\t}\n\n\tprivate _getFormattedDate() {\n\t\tif (!this._value) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn format(this._value, this.format);\n\t}\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const backdropComponentCss = ".fixed{position:fixed!important}.left-0{left:0!important}.top-0{top:0!important}.flex{display:flex!important}.h-full{height:100%!important}.w-full{width:100%!important}.animate-fade-in{animation:fadeIn .2s ease forwards!important}.items-start{align-items:flex-start!important}.items-end{align-items:flex-end!important}.justify-end{justify-content:flex-end!important}.justify-center{justify-content:center!important}.overflow-y-auto{overflow-y:auto!important}.p-0{padding:0!important}.max-h-screen{max-height:100vh!important}*{box-sizing:border-box}:host{animation:fadeIn .2s ease forwards;background-color:rgba(39,40,56,.5);display:flex;height:100%;left:0;max-height:100vh;max-width:100vw;overflow:hidden;position:fixed;top:0;width:100%;z-index:490}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}:host .content-container{align-items:flex-end;display:flex;height:100%;justify-content:center;max-height:100vh;max-width:100vw;overflow-x:hidden;overflow-y:auto;width:100%}@media (min-width:40rem){:host .content-container{padding-left:4rem;padding-right:4rem}}@media (min-width:64rem){:host .content-container{align-items:stretch;padding:4rem}}:host(.blurred){--tw-backdrop-blur:blur(2px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}:host(.closing){animation:fadeOut .2s ease forwards}:host(.closing) .content-container{overflow:hidden}:host(.variant-drawer) .content-container{align-items:flex-start;justify-content:flex-end;padding:0}@media (min-width:64rem){:host(.variant-drawer) .content-container{align-items:flex-start;padding:0}}@media (min-width:40rem){:host(.variant-drawer) .content-container{padding:0}}@media (min-width:40rem){.tablet\\:p-0{padding:0!important}.tablet\\:px-16{padding-left:4rem!important;padding-right:4rem!important}}.static{position:static!important}";
|
|
3
|
+
const backdropComponentCss = ".fixed{position:fixed!important}.left-0{left:0!important}.top-0{top:0!important}.flex{display:flex!important}.h-full{height:100%!important}.w-full{width:100%!important}.animate-fade-in{animation:fadeIn .2s ease forwards!important}.items-start{align-items:flex-start!important}.items-end{align-items:flex-end!important}.justify-end{justify-content:flex-end!important}.justify-center{justify-content:center!important}.overflow-y-auto{overflow-y:auto!important}.p-0{padding:0!important}.pt-16{padding-top:4rem!important}.max-h-screen{max-height:100vh!important}*{box-sizing:border-box}:host{animation:fadeIn .2s ease forwards;background-color:rgba(39,40,56,.5);display:flex;height:100%;left:0;max-height:100vh;max-width:100vw;overflow:hidden;position:fixed;top:0;width:100%;z-index:490}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}:host .content-container{align-items:flex-end;display:flex;height:100%;justify-content:center;max-height:100vh;max-width:100vw;overflow-x:hidden;overflow-y:auto;padding-top:4rem;width:100%}@media (min-width:40rem){:host .content-container{padding-left:4rem;padding-right:4rem}}@media (min-width:64rem){:host .content-container{align-items:stretch;padding:4rem}}:host(.blurred){--tw-backdrop-blur:blur(2px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}:host(.closing){animation:fadeOut .2s ease forwards}:host(.closing) .content-container{overflow:hidden}:host(.variant-drawer) .content-container{align-items:flex-start;justify-content:flex-end;padding:0}@media (min-width:64rem){:host(.variant-drawer) .content-container{align-items:flex-start;padding:0}}@media (min-width:40rem){:host(.variant-drawer) .content-container{padding:0}}@media (min-width:40rem){.tablet\\:p-0{padding:0!important}.tablet\\:px-16{padding-left:4rem!important;padding-right:4rem!important}}.static{position:static!important}";
|
|
4
4
|
|
|
5
5
|
const Backdrop = /*@__PURE__*/ proxyCustomElement(class Backdrop extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"backdrop.component.js","mappings":";;AAAA,MAAM,oBAAoB,GAAG,
|
|
1
|
+
{"file":"backdrop.component.js","mappings":";;AAAA,MAAM,oBAAoB,GAAG,8iEAA8iE;;MCgB9jE,QAAQ;;;;;;mBAIkB,OAAO;qBAKhB,KAAK;mBAKP,KAAK;sBAKF,IAAI;;EAelC,iBAAiB;IAChB,IAAI,IAAI,CAAC,UAAU,EAAE;MACpB,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;KAC7D;GACD;EAED,oBAAoB;IACnB,IAAI,IAAI,CAAC,UAAU,EAAE;MACpB,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;KAChE;GACD;EAED,MAAM;IACL,QACC,EAAC,IAAI,IACJ,KAAK,EAAE,sBAAsB,IAAI,CAAC,OAAO,IACxC,IAAI,CAAC,SAAS,IAAI,SACnB,IAAI,IAAI,CAAC,OAAO,IAAI,SAAS,EAAE,IAE/B,WAAK,KAAK,EAAC,mBAAmB,IAC7B,eAAQ,CACH,CACA,EACN;GACF;EAGD,WAAW,CAAC,EAAc;IACzB,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC,GAAG,EAAE;MAC3B,OAAO;KACP;IAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;GACtB;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/atoms/backdrop/backdrop.component.scss?tag=p-backdrop&encapsulation=shadow","src/components/atoms/backdrop/backdrop.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n\t@apply fixed left-0 top-0 z-backdrop;\n\t@apply h-full w-full;\n\t@apply overflow-hidden;\n\t@apply animate-fade-in bg-storm-dark/50;\n\t@apply max-h-screen max-w-screen;\n\n\t.content-container {\n\t\t@apply h-full w-full overflow-y-auto overflow-x-hidden;\n\t\t@apply pt-16 tablet:px-16 desktop-xs:p-16;\n\t\t@apply flex items-end justify-center desktop-xs:items-stretch;\n\t\t@apply max-h-screen max-w-screen;\n\t}\n}\n\n:host(.blurred) {\n\t@apply backdrop-blur-xs;\n}\n\n:host(.closing) {\n\t@apply animate-fade-out;\n\n\t.content-container {\n\t\t@apply overflow-hidden;\n\t}\n}\n\n:host(.variant-drawer) {\n\t.content-container {\n\t\t@apply items-start justify-end desktop-xs:items-start;\n\t\t@apply p-0 tablet:p-0 desktop-xs:p-0;\n\t}\n}\n","import {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n} from '@stencil/core';\n\n@Component({\n\ttag: 'p-backdrop',\n\tstyleUrl: 'backdrop.component.scss',\n\tshadow: true,\n})\nexport class Backdrop {\n\t/**\n\t * The variant of the backdrop\n\t */\n\t@Prop() variant: 'modal' | 'drawer' = 'modal';\n\n\t/**\n\t * Wether to apply blur on the background of the backdrop\n\t */\n\t@Prop() applyBlur: boolean = false;\n\n\t/**\n\t * Wether the backdrop is closing\n\t */\n\t@Prop() closing: boolean = false;\n\n\t/**\n\t * Wether we should scroll lock the body\n\t */\n\t@Prop() scrollLock: boolean = true;\n\n\t/**\n\t * When the backdrop is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tclicked: EventEmitter<MouseEvent>;\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\tcomponentWillLoad() {\n\t\tif (this.scrollLock) {\n\t\t\tdocument.querySelector(':root').classList.add('scroll-lock');\n\t\t}\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this.scrollLock) {\n\t\t\tdocument.querySelector(':root').classList.remove('scroll-lock');\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={`p-backdrop variant-${this.variant} ${\n\t\t\t\t\tthis.applyBlur && 'blurred'\n\t\t\t\t} ${this.closing && 'closing'}`}\n\t\t\t>\n\t\t\t\t<div class=\"content-container\">\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('click', { capture: true })\n\thandleClick(ev: MouseEvent) {\n\t\tif (ev.target !== this._el) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.clicked.emit(ev);\n\t}\n}\n"],"version":3}
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { d as defineCustomElement$2 } from './icon.component.js';
|
|
3
3
|
import { d as defineCustomElement$1 } from './loader.component.js';
|
|
4
4
|
|
|
5
|
-
const buttonComponentCss = ".flex{display:flex!important}.h-10{height:2.5rem!important}.h-full{height:100%!important}.w-auto{width:auto!important}.cursor-pointer{cursor:pointer!important}.items-center{align-items:center!important}.rounded-large{border-radius:.375rem!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-mystic-dark{--tw-border-opacity:1!important;border-color:rgb(218 230 240/var(--tw-border-opacity))!important}.bg-indigo{background-color:rgb(82 138 250/var(--tw-bg-opacity))!important}.bg-indigo,.bg-white{--tw-bg-opacity:1!important}.bg-white{background-color:rgb(255 255 255/var(--tw-bg-opacity))!important}.px-4{padding-left:1rem!important;padding-right:1rem!important}.font-semibold{font-weight:600!important}.underline{text-decoration-line:underline!important}.outline{outline-style:solid!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}*{box-sizing:border-box}p-button{height:2.5rem;width:auto}p-button,p-button a,p-button button{display:flex;font-size:1rem;line-height:1.5rem}p-button a,p-button button{align-items:center;border:0;border-radius:.375rem!important;cursor:pointer;font-weight:600;height:100%;justify-content:center;outline:0;width:100%;will-change:filter}p-button a.icon-position-end>p-icon:not(.chevron),p-button a>p-loader,p-button button.icon-position-end>p-icon:not(.chevron),p-button button>p-loader{margin-left:.5rem}p-button a.icon-position-start>p-icon:not(.chevron),p-button button.icon-position-start>p-icon:not(.chevron){margin-right:.5rem}p-button a.variant-primary,p-button a.variant-secondary,p-button button.variant-primary,p-button button.variant-secondary{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);padding-left:1rem;padding-right:1rem}p-button a.variant-primary.active,p-button a.variant-primary:active,p-button a.variant-secondary.active,p-button a.variant-secondary:active,p-button button.variant-primary.active,p-button button.variant-primary:active,p-button button.variant-secondary.active,p-button button.variant-secondary:active{--tw-drop-shadow:drop-shadow(transparent);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}p-button a.variant-primary,p-button button.variant-primary{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(82 138 250/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity))}p-button a.variant-primary.active:not([disabled]),p-button a.variant-primary:active:not([disabled]),p-button button.variant-primary.active:not([disabled]),p-button button.variant-primary:active:not([disabled]){--tw-bg-opacity:1;background-color:rgb(44 75 169/var(--tw-bg-opacity))}@media (pointer:fine){p-button a.variant-primary:hover:not([disabled]),p-button button.variant-primary:hover:not([disabled]){--tw-drop-shadow:drop-shadow(0px 2px 4px rgba(44,75,169,.4));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}}p-button a.variant-secondary,p-button button.variant-secondary{--tw-border-opacity:1!important;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(218 230 240/var(--tw-border-opacity))!important;border-style:solid!important;border-width:1px!important;color:rgb(81 83 107/var(--tw-text-opacity))}p-button a.variant-secondary.active:not([disabled]),p-button a.variant-secondary:active:not([disabled]),p-button button.variant-secondary.active:not([disabled]),p-button button.variant-secondary:active:not([disabled]){--tw-bg-opacity:1;background-color:rgb(247 250 252/var(--tw-bg-opacity))}@media (pointer:fine){p-button a.variant-secondary:hover:not([disabled]),p-button button.variant-secondary:hover:not([disabled]){--tw-drop-shadow:drop-shadow(0px 2px 4px rgba(176,178,203,.4));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}}p-button a.variant-text,p-button button.variant-text{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity))}p-button a.variant-text.has-underline,p-button button.variant-text.has-underline{text-decoration-line:underline;text-underline-offset:1px}p-button a.variant-text:hover:not([disabled]),p-button button.variant-text:hover:not([disabled]){--tw-text-opacity:1;color:rgb(44 75 169/var(--tw-text-opacity))}p-button a[disabled],p-button button[disabled]{opacity:.4}p-button a.should-inherit-text,p-button button.should-inherit-text{color:inherit!important;font-size:inherit!important;font-weight:inherit!important}p-button.has-chevron a.chevron-position-start,p-button.has-chevron button.chevron-position-start{padding-left:.5rem}p-button.has-chevron a.chevron-position-start>p-icon.chevron,p-button.has-chevron button.chevron-position-start>p-icon.chevron{margin-right:.5rem}p-button.has-chevron a.chevron-position-end,p-button.has-chevron button.chevron-position-end{padding-right:.5rem}p-button.has-chevron a.chevron-position-end>p-icon.chevron,p-button.has-chevron button.chevron-position-end>p-icon.chevron{margin-left:.5rem}p-button.has-chevron a.variant-secondary:hover:not([disabled]) p-icon:last-child,p-button.has-chevron button.variant-secondary:hover:not([disabled]) p-icon:last-child{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity))}p-button.has-icon-only{width:2.5rem}p-button.has-icon-only a,p-button.has-icon-only button{padding:0}p-button.has-icon-only a>p-icon:first-child,p-button.has-icon-only button>p-icon:first-child{margin-left:0;margin-right:0}p-button.has-icon-only a>p-loader,p-button.has-icon-only button>p-loader{margin-left:0}p-button.has-icon-only.has-chevron{width:auto}p-button.has-icon-only.has-chevron a.chevron-position-start,p-button.has-icon-only.has-chevron button.chevron-position-start{padding-right:.5rem}p-button.has-icon-only.has-chevron a.chevron-position-end,p-button.has-icon-only.has-chevron button.chevron-position-end{padding-left:.5rem}p-button.size-small{height:2rem}p-button.size-small a,p-button.size-small button{font-size:.875rem;line-height:1.25rem}p-button.size-small a>p-icon,p-button.size-small button>p-icon{font-size:1rem;line-height:1.5rem}p-button.size-small.has-icon-only{width:2rem}p-button.size-small.has-icon-only.has-chevron{width:auto}.static{position:static!important}";
|
|
5
|
+
const buttonComponentCss = ".flex{display:flex!important}.h-10{height:2.5rem!important}.h-full{height:100%!important}.w-auto{width:auto!important}.cursor-pointer{cursor:pointer!important}.items-center{align-items:center!important}.rounded-large{border-radius:.375rem!important}.rounded-none{border-radius:0!important}.rounded-l-none{border-bottom-left-radius:0!important;border-top-left-radius:0!important}.rounded-r-none{border-bottom-right-radius:0!important;border-top-right-radius:0!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-mystic-dark{--tw-border-opacity:1!important;border-color:rgb(218 230 240/var(--tw-border-opacity))!important}.bg-indigo{background-color:rgb(82 138 250/var(--tw-bg-opacity))!important}.bg-indigo,.bg-white{--tw-bg-opacity:1!important}.bg-white{background-color:rgb(255 255 255/var(--tw-bg-opacity))!important}.px-4{padding-left:1rem!important;padding-right:1rem!important}.font-semibold{font-weight:600!important}.underline{text-decoration-line:underline!important}.outline{outline-style:solid!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}*{box-sizing:border-box}p-button{height:2.5rem;width:auto}p-button,p-button a,p-button button{display:flex;font-size:1rem;line-height:1.5rem}p-button a,p-button button{align-items:center;border:0;border-radius:.375rem!important;cursor:pointer;font-weight:600;height:100%;justify-content:center;outline:0;width:100%;will-change:filter}p-button a.icon-position-end>p-icon:not(.chevron),p-button a>p-loader,p-button button.icon-position-end>p-icon:not(.chevron),p-button button>p-loader{margin-left:.5rem}p-button a.icon-position-start>p-icon:not(.chevron),p-button button.icon-position-start>p-icon:not(.chevron){margin-right:.5rem}p-button a.variant-primary,p-button a.variant-secondary,p-button button.variant-primary,p-button button.variant-secondary{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);padding-left:1rem;padding-right:1rem}p-button a.variant-primary.active,p-button a.variant-primary:active,p-button a.variant-secondary.active,p-button a.variant-secondary:active,p-button button.variant-primary.active,p-button button.variant-primary:active,p-button button.variant-secondary.active,p-button button.variant-secondary:active{--tw-drop-shadow:drop-shadow(transparent);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}p-button a.variant-primary,p-button button.variant-primary{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(82 138 250/var(--tw-bg-opacity));color:rgb(255 255 255/var(--tw-text-opacity))}p-button a.variant-primary.active:not([disabled]),p-button a.variant-primary:active:not([disabled]),p-button button.variant-primary.active:not([disabled]),p-button button.variant-primary:active:not([disabled]){--tw-bg-opacity:1;background-color:rgb(44 75 169/var(--tw-bg-opacity))}@media (pointer:fine){p-button a.variant-primary:hover:not([disabled]),p-button button.variant-primary:hover:not([disabled]){--tw-drop-shadow:drop-shadow(0px 2px 4px rgba(44,75,169,.4));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}}p-button a.variant-secondary,p-button button.variant-secondary{--tw-border-opacity:1!important;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(218 230 240/var(--tw-border-opacity))!important;border-style:solid!important;border-width:1px!important;color:rgb(81 83 107/var(--tw-text-opacity))}p-button a.variant-secondary.active:not([disabled]),p-button a.variant-secondary:active:not([disabled]),p-button button.variant-secondary.active:not([disabled]),p-button button.variant-secondary:active:not([disabled]){--tw-bg-opacity:1;background-color:rgb(247 250 252/var(--tw-bg-opacity))}@media (pointer:fine){p-button a.variant-secondary:hover:not([disabled]),p-button button.variant-secondary:hover:not([disabled]){--tw-drop-shadow:drop-shadow(0px 2px 4px rgba(176,178,203,.4));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}}p-button a.variant-text,p-button button.variant-text{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity))}p-button a.variant-text.has-underline,p-button button.variant-text.has-underline{text-decoration-line:underline;text-underline-offset:1px}p-button a.variant-text:hover:not([disabled]),p-button button.variant-text:hover:not([disabled]){--tw-text-opacity:1;color:rgb(44 75 169/var(--tw-text-opacity))}p-button a[disabled],p-button button[disabled]{opacity:.4}p-button a.should-inherit-text,p-button button.should-inherit-text{color:inherit!important;font-size:inherit!important;font-weight:inherit!important}p-button a.button-group-pos-start,p-button button.button-group-pos-start{border-bottom-right-radius:0!important;border-top-right-radius:0!important}p-button a.button-group-pos-middle,p-button button.button-group-pos-middle{border-radius:0!important}p-button a.button-group-pos-end,p-button button.button-group-pos-end{border-bottom-left-radius:0!important;border-top-left-radius:0!important}p-button.has-chevron a.chevron-position-start,p-button.has-chevron button.chevron-position-start{padding-left:.5rem}p-button.has-chevron a.chevron-position-start>p-icon.chevron,p-button.has-chevron button.chevron-position-start>p-icon.chevron{margin-right:.5rem}p-button.has-chevron a.chevron-position-end,p-button.has-chevron button.chevron-position-end{padding-right:.5rem}p-button.has-chevron a.chevron-position-end>p-icon.chevron,p-button.has-chevron button.chevron-position-end>p-icon.chevron{margin-left:.5rem}p-button.has-chevron a.variant-secondary:hover:not([disabled]) p-icon:last-child,p-button.has-chevron button.variant-secondary:hover:not([disabled]) p-icon:last-child{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity))}p-button.has-icon-only{width:2.5rem}p-button.has-icon-only a,p-button.has-icon-only button{padding:0}p-button.has-icon-only a>p-icon:first-child,p-button.has-icon-only button>p-icon:first-child{margin-left:0;margin-right:0}p-button.has-icon-only a>p-loader,p-button.has-icon-only button>p-loader{margin-left:0}p-button.has-icon-only.has-chevron{width:auto}p-button.has-icon-only.has-chevron a.chevron-position-start,p-button.has-icon-only.has-chevron button.chevron-position-start{padding-right:.5rem}p-button.has-icon-only.has-chevron a.chevron-position-end,p-button.has-icon-only.has-chevron button.chevron-position-end{padding-left:.5rem}p-button.size-small{height:2rem}p-button.size-small a,p-button.size-small button{font-size:.875rem;line-height:1.25rem}p-button.size-small a>p-icon,p-button.size-small button>p-icon{font-size:1rem;line-height:1.5rem}p-button.size-small.has-icon-only{width:2rem}p-button.size-small.has-icon-only.has-chevron{width:auto}.static{position:static!important}";
|
|
6
6
|
|
|
7
7
|
const Button = /*@__PURE__*/ proxyCustomElement(class Button extends HTMLElement {
|
|
8
8
|
constructor() {
|
|
@@ -26,6 +26,7 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends HTMLElement
|
|
|
26
26
|
this.iconFlip = undefined;
|
|
27
27
|
this.iconRotate = undefined;
|
|
28
28
|
this.inheritText = false;
|
|
29
|
+
this.buttonGroupPosition = 'none';
|
|
29
30
|
}
|
|
30
31
|
render() {
|
|
31
32
|
var _a;
|
|
@@ -41,7 +42,8 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends HTMLElement
|
|
|
41
42
|
const VariableTag = this.variant === 'text' || ((_a = this.href) === null || _a === void 0 ? void 0 : _a.length) || this.as === 'a'
|
|
42
43
|
? 'a'
|
|
43
44
|
: 'button';
|
|
44
|
-
return (h(Host, { class: `p-button size-${this.size} ${this.iconOnly && 'has-icon-only'} ${this.chevron && 'has-chevron'}` }, h(VariableTag, { class: `variant-${this.variant} icon-position-${this.iconPosition} chevron-position-${this.chevronPosition} ${this.inheritText && 'should-inherit-text'} ${this.underline && 'has-underline'}
|
|
45
|
+
return (h(Host, { class: `p-button size-${this.size} ${this.iconOnly && 'has-icon-only'} ${this.chevron && 'has-chevron'}` }, h(VariableTag, { class: `variant-${this.variant} icon-position-${this.iconPosition} chevron-position-${this.chevronPosition} ${this.inheritText && 'should-inherit-text'} ${this.underline && 'has-underline'} ${this.buttonGroupPosition !== 'none' &&
|
|
46
|
+
`button-group-pos-${this.buttonGroupPosition}`}`, disabled: this.disabled, href: this.href, type: this.variant !== 'text' ? this.type : undefined, target: this.target }, this.chevron && this.chevronPosition === 'start' && (h("p-icon", { class: 'chevron', variant: 'chevron', rotate: this.chevron === 'up' ? 180 : 0 })), this.icon &&
|
|
45
47
|
this.iconPosition === 'start' &&
|
|
46
48
|
!(this.iconOnly && this.loading) &&
|
|
47
49
|
this._getIcon(), h("slot", null), this.icon &&
|
|
@@ -80,7 +82,8 @@ const Button = /*@__PURE__*/ proxyCustomElement(class Button extends HTMLElement
|
|
|
80
82
|
"iconPosition": [1, "icon-position"],
|
|
81
83
|
"iconFlip": [1, "icon-flip"],
|
|
82
84
|
"iconRotate": [2, "icon-rotate"],
|
|
83
|
-
"inheritText": [4, "inherit-text"]
|
|
85
|
+
"inheritText": [4, "inherit-text"],
|
|
86
|
+
"buttonGroupPosition": [1, "button-group-position"]
|
|
84
87
|
}, [[2, "click", "handleClick"]]]);
|
|
85
88
|
function defineCustomElement() {
|
|
86
89
|
if (typeof customElements === "undefined") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"button.component.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,qlNAAqlN;;MCiBnmN,MAAM;;;;;cAIW,QAAQ;mBAKe,SAAS;qBAKhC,KAAK;;;gBAeC,Q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CAAC,IAAI;MACT,IAAI,CAAC,YAAY,KAAK,OAAO;MAC7B,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC;MAChC,IAAI,CAAC,QAAQ,EAAE,EAEhB,eAAQ,EAEP,IAAI,CAAC,IAAI;MACT,IAAI,CAAC,YAAY,KAAK,KAAK;MAC3B,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC;MAChC,IAAI,CAAC,QAAQ,EAAE,EAEf,IAAI,CAAC,OAAO,IAAI,gBAAU,KAAK,EAAE,WAAW,GAAI,EAEhD,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,eAAe,KAAK,KAAK,KAC9C,cACC,KAAK,EAAC,SAAS,EACf,OAAO,EAAC,SAAS,EACjB,MAAM,EAAE,IAAI,CAAC,OAAO,KAAK,IAAI,GAAG,GAAG,GAAG,CAAC,GACtC,CACF,CACY,CACR,EACN;GACF;EAGD,WAAW,CAAC,EAAc;IACzB,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;MAClC,EAAE,CAAC,cAAc,EAAE,CAAC;MACpB,OAAO;KACP;IAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;GACtB;EAEO,QAAQ;IACf,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;MACf,OAAO;KACP;IAED,QACC,cACC,OAAO,EAAE,IAAI,CAAC,IAAI,EAClB,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,MAAM,EAAE,IAAI,CAAC,UAAU,GACtB,EACD;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/atoms/button/button.component.scss?tag=p-button","src/components/atoms/button/button.component.tsx"],"sourcesContent":["p-button {\n\t@apply flex h-10 w-auto text-base;\n\n\tbutton,\n\ta {\n\t\toutline: 0;\n\t\tborder: 0;\n\t\t@apply h-full w-full;\n\t\t@apply rounded-large #{!important};\n\t\t@apply font-semibold leading-4;\n\t\t@apply flex items-center justify-center;\n\t\t@apply cursor-pointer text-base;\n\n\t\twill-change: filter;\n\n\t\t> p-loader {\n\t\t\t@apply ml-2;\n\t\t}\n\n\t\t// Icon positions\n\t\t&.icon-position-end {\n\t\t\t> p-icon:not(.chevron) {\n\t\t\t\t@apply ml-2;\n\t\t\t}\n\t\t}\n\n\t\t&.icon-position-start {\n\t\t\t> p-icon:not(.chevron) {\n\t\t\t\t@apply mr-2;\n\t\t\t}\n\t\t}\n\n\t\t// Variants\n\t\t&.variant-primary,\n\t\t&.variant-secondary {\n\t\t\t@apply px-4 filter;\n\t\t}\n\n\t\t&.variant-primary,\n\t\t&.variant-secondary {\n\t\t\t&:active,\n\t\t\t&.active {\n\t\t\t\t@apply drop-shadow-transparent;\n\t\t\t}\n\t\t}\n\n\t\t&.variant-primary {\n\t\t\t@apply bg-indigo text-white;\n\n\t\t\t&:active,\n\t\t\t&.active {\n\t\t\t\t&:not([disabled]) {\n\t\t\t\t\t@apply bg-indigo-dark;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@media (pointer: fine) {\n\t\t\t\t&:hover:not([disabled]) {\n\t\t\t\t\t@apply drop-shadow-button-primary-hover;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t&.variant-secondary {\n\t\t\t@apply border border-solid border-mystic-dark #{!important};\n\t\t\t@apply bg-white text-storm;\n\n\t\t\t&:active,\n\t\t\t&.active {\n\t\t\t\t&:not([disabled]) {\n\t\t\t\t\t@apply bg-mystic;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@media (pointer: fine) {\n\t\t\t\t&:hover:not([disabled]) {\n\t\t\t\t\t@apply drop-shadow-button-secondary-hover;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t&.variant-text {\n\t\t\t@apply text-indigo;\n\n\t\t\t&.has-underline {\n\t\t\t\t@apply underline underline-offset-1;\n\t\t\t}\n\n\t\t\t&:hover:not([disabled]) {\n\t\t\t\t@apply text-indigo-dark;\n\t\t\t}\n\t\t}\n\n\t\t&[disabled] {\n\t\t\t@apply opacity-40;\n\t\t}\n\n\t\t&.should-inherit-text {\n\t\t\tcolor: inherit #{!important};\n\t\t\tfont-size: inherit #{!important};\n\t\t\tfont-weight: inherit #{!important};\n\t\t}\n\t}\n\n\t// chevron\n\t&.has-chevron {\n\t\ta,\n\t\tbutton {\n\t\t\t&.chevron-position-start {\n\t\t\t\t@apply pl-2;\n\n\t\t\t\t> p-icon.chevron {\n\t\t\t\t\t@apply mr-2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&.chevron-position-end {\n\t\t\t\t@apply pr-2;\n\n\t\t\t\t> p-icon.chevron {\n\t\t\t\t\t@apply ml-2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&.variant-secondary:hover:not([disabled]) p-icon:last-child {\n\t\t\t\t@apply text-indigo;\n\t\t\t}\n\t\t}\n\t}\n\n\t&.has-icon-only {\n\t\t@apply w-10;\n\n\t\ta,\n\t\tbutton {\n\t\t\t@apply p-0;\n\n\t\t\t> p-icon:first-child {\n\t\t\t\t@apply mx-0;\n\t\t\t}\n\n\t\t\t> p-loader {\n\t\t\t\t@apply ml-0;\n\t\t\t}\n\t\t}\n\n\t\t&.has-chevron {\n\t\t\t@apply w-auto;\n\n\t\t\ta,\n\t\t\tbutton {\n\t\t\t\t&.chevron-position-start {\n\t\t\t\t\t@apply pr-2;\n\t\t\t\t}\n\n\t\t\t\t&.chevron-position-end {\n\t\t\t\t\t@apply pl-2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// sizes\n\t&.size-small {\n\t\t@apply h-8;\n\n\t\tbutton,\n\t\ta {\n\t\t\t@apply text-sm;\n\n\t\t\t> p-icon {\n\t\t\t\t@apply text-base;\n\t\t\t}\n\t\t}\n\n\t\t&.has-icon-only {\n\t\t\t@apply w-8;\n\n\t\t\t&.has-chevron {\n\t\t\t\t@apply w-auto;\n\t\t\t}\n\t\t}\n\t}\n}\n","import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n} from '@stencil/core';\nimport { RotateOptions } from '../../../types/tailwind';\nimport { IconFlipOptions, IconVariant } from '../icon/icon.component';\n\n@Component({\n\ttag: 'p-button',\n\tstyleUrl: 'button.component.scss',\n\t// shadow: true,\n})\nexport class Button {\n\t/**\n\t * The type of the button\n\t */\n\t@Prop() as: 'a' | 'button' = 'button';\n\n\t/**\n\t * The variant of the button\n\t */\n\t@Prop() variant: 'primary' | 'secondary' | 'text' = 'primary';\n\n\t/**\n\t * Wether the text variant has underline\n\t */\n\t@Prop() underline: boolean = false;\n\n\t/**\n\t * Href in case of \"text\" version\n\t */\n\t@Prop() href: string;\n\n\t/**\n\t * Target in case of \"text\" version\n\t */\n\t@Prop() target: string;\n\n\t/**\n\t * The size of the button\n\t */\n\t@Prop() size: 'small' | 'medium' = 'medium';\n\n\t/**\n\t * The type of the button\n\t */\n\t@Prop() type: 'button' | 'submit' = 'button';\n\n\t/**\n\t * Wether to show a loader or not\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * Wether to show a chevron or not\n\t */\n\t@Prop() chevron: boolean | 'up' | 'down' = false;\n\n\t/**\n\t * Chevron position\n\t */\n\t@Prop() chevronPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Wether the button is disabled\n\t */\n\t@Prop() disabled: boolean = false;\n\n\t/**\n\t * Icon to show on the button\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * Wether the button is icon only\n\t */\n\t@Prop() iconOnly: boolean = false;\n\n\t/**\n\t * Icon position\n\t */\n\t@Prop() iconPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Icon flip\n\t */\n\t@Prop() iconFlip: IconFlipOptions;\n\n\t/**\n\t * Icon rotate\n\t */\n\t@Prop() iconRotate: RotateOptions;\n\n\t/**\n\t * Wether the button should inherit text styles\n\t */\n\t@Prop() inheritText: boolean = false;\n\n\t/**\n\t * Button click event\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tonClick: EventEmitter<MouseEvent>;\n\n\trender() {\n\t\tlet loaderColor: 'white' | 'storm' | 'indigo' = 'white';\n\t\tswitch (this.variant) {\n\t\t\tcase 'secondary':\n\t\t\t\tloaderColor = 'storm';\n\t\t\t\tbreak;\n\t\t\tcase 'text':\n\t\t\t\tloaderColor = 'indigo';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst VariableTag =\n\t\t\tthis.variant === 'text' || this.href?.length || this.as === 'a'\n\t\t\t\t? 'a'\n\t\t\t\t: 'button';\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={`p-button size-${this.size} ${\n\t\t\t\t\tthis.iconOnly && 'has-icon-only'\n\t\t\t\t} ${this.chevron && 'has-chevron'}`}\n\t\t\t>\n\t\t\t\t<VariableTag\n\t\t\t\t\tclass={`variant-${this.variant} icon-position-${\n\t\t\t\t\t\tthis.iconPosition\n\t\t\t\t\t} chevron-position-${this.chevronPosition} ${\n\t\t\t\t\t\tthis.inheritText && 'should-inherit-text'\n\t\t\t\t\t} ${this.underline && 'has-underline'}`}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttype={this.variant !== 'text' ? this.type : undefined}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t>\n\t\t\t\t\t{this.chevron && this.chevronPosition === 'start' && (\n\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\tclass='chevron'\n\t\t\t\t\t\t\tvariant='chevron'\n\t\t\t\t\t\t\trotate={this.chevron === 'up' ? 180 : 0}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{this.icon &&\n\t\t\t\t\t\tthis.iconPosition === 'start' &&\n\t\t\t\t\t\t!(this.iconOnly && this.loading) &&\n\t\t\t\t\t\tthis._getIcon()}\n\n\t\t\t\t\t<slot />\n\n\t\t\t\t\t{this.icon &&\n\t\t\t\t\t\tthis.iconPosition === 'end' &&\n\t\t\t\t\t\t!(this.iconOnly && this.loading) &&\n\t\t\t\t\t\tthis._getIcon()}\n\n\t\t\t\t\t{this.loading && <p-loader color={loaderColor} />}\n\n\t\t\t\t\t{this.chevron && this.chevronPosition === 'end' && (\n\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\tclass='chevron'\n\t\t\t\t\t\t\tvariant='chevron'\n\t\t\t\t\t\t\trotate={this.chevron === 'up' ? 180 : 0}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</VariableTag>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('click', { capture: true })\n\thandleClick(ev: MouseEvent) {\n\t\tif (this.loading || this.disabled) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.onClick.emit(ev);\n\t}\n\n\tprivate _getIcon() {\n\t\tif (!this.icon) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn (\n\t\t\t<p-icon\n\t\t\t\tvariant={this.icon}\n\t\t\t\tflip={this.iconFlip}\n\t\t\t\trotate={this.iconRotate}\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"button.component.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,wrOAAwrO;;MCiBtsO,MAAM;;;;;cAIW,QAAQ;mBAKe,SAAS;qBAKhC,KAAK;;;gBAeC,QAAQ;gBAKP,QAAQ;mBAKjB,KAAK;mBAKW,KAAK;2BAKL,KAAK;oBAKpB,KAAK;;oBAUL,KAAK;wBAKO,KAAK;;;uBAed,KAAK;+BAK+B,MAAM;;EAUzE,MAAM;;IACL,IAAI,WAAW,GAAiC,OAAO,CAAC;IACxD,QAAQ,IAAI,CAAC,OAAO;MACnB,KAAK,WAAW;QACf,WAAW,GAAG,OAAO,CAAC;QACtB,MAAM;MACP,KAAK,MAAM;QACV,WAAW,GAAG,QAAQ,CAAC;QACvB,MAAM;KACP;IAED,MAAM,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AI,CAAC,OAAO,CAAC;MAChC,IAAI,CAAC,QAAQ,EAAE,EAEf,IAAI,CAAC,OAAO,IAAI,gBAAU,KAAK,EAAE,WAAW,GAAI,EAEhD,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,eAAe,KAAK,KAAK,KAC9C,cACC,KAAK,EAAC,SAAS,EACf,OAAO,EAAC,SAAS,EACjB,MAAM,EAAE,IAAI,CAAC,OAAO,KAAK,IAAI,GAAG,GAAG,GAAG,CAAC,GACtC,CACF,CACY,CACR,EACN;GACF;EAGD,WAAW,CAAC,EAAc;IACzB,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;MAClC,EAAE,CAAC,cAAc,EAAE,CAAC;MACpB,OAAO;KACP;IAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;GACtB;EAEO,QAAQ;IACf,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;MACf,OAAO;KACP;IAED,QACC,cACC,OAAO,EAAE,IAAI,CAAC,IAAI,EAClB,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,MAAM,EAAE,IAAI,CAAC,UAAU,GACtB,EACD;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/atoms/button/button.component.scss?tag=p-button","src/components/atoms/button/button.component.tsx"],"sourcesContent":["p-button {\n\t@apply flex h-10 w-auto text-base;\n\n\tbutton,\n\ta {\n\t\toutline: 0;\n\t\tborder: 0;\n\t\t@apply h-full w-full;\n\t\t@apply rounded-large #{!important};\n\t\t@apply font-semibold leading-4;\n\t\t@apply flex items-center justify-center;\n\t\t@apply cursor-pointer text-base;\n\n\t\twill-change: filter;\n\n\t\t> p-loader {\n\t\t\t@apply ml-2;\n\t\t}\n\n\t\t// Icon positions\n\t\t&.icon-position-end {\n\t\t\t> p-icon:not(.chevron) {\n\t\t\t\t@apply ml-2;\n\t\t\t}\n\t\t}\n\n\t\t&.icon-position-start {\n\t\t\t> p-icon:not(.chevron) {\n\t\t\t\t@apply mr-2;\n\t\t\t}\n\t\t}\n\n\t\t// Variants\n\t\t&.variant-primary,\n\t\t&.variant-secondary {\n\t\t\t@apply px-4 filter;\n\t\t}\n\n\t\t&.variant-primary,\n\t\t&.variant-secondary {\n\t\t\t&:active,\n\t\t\t&.active {\n\t\t\t\t@apply drop-shadow-transparent;\n\t\t\t}\n\t\t}\n\n\t\t&.variant-primary {\n\t\t\t@apply bg-indigo text-white;\n\n\t\t\t&:active,\n\t\t\t&.active {\n\t\t\t\t&:not([disabled]) {\n\t\t\t\t\t@apply bg-indigo-dark;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@media (pointer: fine) {\n\t\t\t\t&:hover:not([disabled]) {\n\t\t\t\t\t@apply drop-shadow-button-primary-hover;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t&.variant-secondary {\n\t\t\t@apply border border-solid border-mystic-dark #{!important};\n\t\t\t@apply bg-white text-storm;\n\n\t\t\t&:active,\n\t\t\t&.active {\n\t\t\t\t&:not([disabled]) {\n\t\t\t\t\t@apply bg-mystic;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@media (pointer: fine) {\n\t\t\t\t&:hover:not([disabled]) {\n\t\t\t\t\t@apply drop-shadow-button-secondary-hover;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t&.variant-text {\n\t\t\t@apply text-indigo;\n\n\t\t\t&.has-underline {\n\t\t\t\t@apply underline underline-offset-1;\n\t\t\t}\n\n\t\t\t&:hover:not([disabled]) {\n\t\t\t\t@apply text-indigo-dark;\n\t\t\t}\n\t\t}\n\n\t\t&[disabled] {\n\t\t\t@apply opacity-40;\n\t\t}\n\n\t\t&.should-inherit-text {\n\t\t\tcolor: inherit #{!important};\n\t\t\tfont-size: inherit #{!important};\n\t\t\tfont-weight: inherit #{!important};\n\t\t}\n\n\t\t&.button-group-pos-start {\n\t\t\t@apply rounded-r-none #{!important};\n\t\t}\n\n\t\t&.button-group-pos-middle {\n\t\t\t@apply rounded-none #{!important};\n\t\t}\n\n\t\t&.button-group-pos-end {\n\t\t\t@apply rounded-l-none #{!important};\n\t\t}\n\t}\n\n\t// chevron\n\t&.has-chevron {\n\t\ta,\n\t\tbutton {\n\t\t\t&.chevron-position-start {\n\t\t\t\t@apply pl-2;\n\n\t\t\t\t> p-icon.chevron {\n\t\t\t\t\t@apply mr-2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&.chevron-position-end {\n\t\t\t\t@apply pr-2;\n\n\t\t\t\t> p-icon.chevron {\n\t\t\t\t\t@apply ml-2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&.variant-secondary:hover:not([disabled]) p-icon:last-child {\n\t\t\t\t@apply text-indigo;\n\t\t\t}\n\t\t}\n\t}\n\n\t&.has-icon-only {\n\t\t@apply w-10;\n\n\t\ta,\n\t\tbutton {\n\t\t\t@apply p-0;\n\n\t\t\t> p-icon:first-child {\n\t\t\t\t@apply mx-0;\n\t\t\t}\n\n\t\t\t> p-loader {\n\t\t\t\t@apply ml-0;\n\t\t\t}\n\t\t}\n\n\t\t&.has-chevron {\n\t\t\t@apply w-auto;\n\n\t\t\ta,\n\t\t\tbutton {\n\t\t\t\t&.chevron-position-start {\n\t\t\t\t\t@apply pr-2;\n\t\t\t\t}\n\n\t\t\t\t&.chevron-position-end {\n\t\t\t\t\t@apply pl-2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// sizes\n\t&.size-small {\n\t\t@apply h-8;\n\n\t\tbutton,\n\t\ta {\n\t\t\t@apply text-sm;\n\n\t\t\t> p-icon {\n\t\t\t\t@apply text-base;\n\t\t\t}\n\t\t}\n\n\t\t&.has-icon-only {\n\t\t\t@apply w-8;\n\n\t\t\t&.has-chevron {\n\t\t\t\t@apply w-auto;\n\t\t\t}\n\t\t}\n\t}\n}\n","import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n} from '@stencil/core';\nimport { RotateOptions } from '../../../types/tailwind';\nimport { IconFlipOptions, IconVariant } from '../icon/icon.component';\n\n@Component({\n\ttag: 'p-button',\n\tstyleUrl: 'button.component.scss',\n\t// shadow: true,\n})\nexport class Button {\n\t/**\n\t * The type of the button\n\t */\n\t@Prop() as: 'a' | 'button' = 'button';\n\n\t/**\n\t * The variant of the button\n\t */\n\t@Prop() variant: 'primary' | 'secondary' | 'text' = 'primary';\n\n\t/**\n\t * Wether the text variant has underline\n\t */\n\t@Prop() underline: boolean = false;\n\n\t/**\n\t * Href in case of \"text\" version\n\t */\n\t@Prop() href: string;\n\n\t/**\n\t * Target in case of \"text\" version\n\t */\n\t@Prop() target: string;\n\n\t/**\n\t * The size of the button\n\t */\n\t@Prop() size: 'small' | 'medium' = 'medium';\n\n\t/**\n\t * The type of the button\n\t */\n\t@Prop() type: 'button' | 'submit' = 'button';\n\n\t/**\n\t * Wether to show a loader or not\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * Wether to show a chevron or not\n\t */\n\t@Prop() chevron: boolean | 'up' | 'down' = false;\n\n\t/**\n\t * Chevron position\n\t */\n\t@Prop() chevronPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Wether the button is disabled\n\t */\n\t@Prop() disabled: boolean = false;\n\n\t/**\n\t * Icon to show on the button\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * Wether the button is icon only\n\t */\n\t@Prop() iconOnly: boolean = false;\n\n\t/**\n\t * Icon position\n\t */\n\t@Prop() iconPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * Icon flip\n\t */\n\t@Prop() iconFlip: IconFlipOptions;\n\n\t/**\n\t * Icon rotate\n\t */\n\t@Prop() iconRotate: RotateOptions;\n\n\t/**\n\t * Wether the button should inherit text styles\n\t */\n\t@Prop() inheritText: boolean = false;\n\n\t/**\n\t * Position of the button in the button group, mostly un-used if not in a group\n\t */\n\t@Prop() buttonGroupPosition: 'start' | 'middle' | 'end' | 'none' = 'none';\n\n\t/**\n\t * Button click event\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tonClick: EventEmitter<MouseEvent>;\n\n\trender() {\n\t\tlet loaderColor: 'white' | 'storm' | 'indigo' = 'white';\n\t\tswitch (this.variant) {\n\t\t\tcase 'secondary':\n\t\t\t\tloaderColor = 'storm';\n\t\t\t\tbreak;\n\t\t\tcase 'text':\n\t\t\t\tloaderColor = 'indigo';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tconst VariableTag =\n\t\t\tthis.variant === 'text' || this.href?.length || this.as === 'a'\n\t\t\t\t? 'a'\n\t\t\t\t: 'button';\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={`p-button size-${this.size} ${\n\t\t\t\t\tthis.iconOnly && 'has-icon-only'\n\t\t\t\t} ${this.chevron && 'has-chevron'}`}\n\t\t\t>\n\t\t\t\t<VariableTag\n\t\t\t\t\tclass={`variant-${this.variant} icon-position-${\n\t\t\t\t\t\tthis.iconPosition\n\t\t\t\t\t} chevron-position-${this.chevronPosition} ${\n\t\t\t\t\t\tthis.inheritText && 'should-inherit-text'\n\t\t\t\t\t} ${this.underline && 'has-underline'} ${\n\t\t\t\t\t\tthis.buttonGroupPosition !== 'none' &&\n\t\t\t\t\t\t`button-group-pos-${this.buttonGroupPosition}`\n\t\t\t\t\t}`}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttype={this.variant !== 'text' ? this.type : undefined}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t>\n\t\t\t\t\t{this.chevron && this.chevronPosition === 'start' && (\n\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\tclass='chevron'\n\t\t\t\t\t\t\tvariant='chevron'\n\t\t\t\t\t\t\trotate={this.chevron === 'up' ? 180 : 0}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{this.icon &&\n\t\t\t\t\t\tthis.iconPosition === 'start' &&\n\t\t\t\t\t\t!(this.iconOnly && this.loading) &&\n\t\t\t\t\t\tthis._getIcon()}\n\n\t\t\t\t\t<slot />\n\n\t\t\t\t\t{this.icon &&\n\t\t\t\t\t\tthis.iconPosition === 'end' &&\n\t\t\t\t\t\t!(this.iconOnly && this.loading) &&\n\t\t\t\t\t\tthis._getIcon()}\n\n\t\t\t\t\t{this.loading && <p-loader color={loaderColor} />}\n\n\t\t\t\t\t{this.chevron && this.chevronPosition === 'end' && (\n\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\tclass='chevron'\n\t\t\t\t\t\t\tvariant='chevron'\n\t\t\t\t\t\t\trotate={this.chevron === 'up' ? 180 : 0}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</VariableTag>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('click', { capture: true })\n\thandleClick(ev: MouseEvent) {\n\t\tif (this.loading || this.disabled) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.onClick.emit(ev);\n\t}\n\n\tprivate _getIcon() {\n\t\tif (!this.icon) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn (\n\t\t\t<p-icon\n\t\t\t\tvariant={this.icon}\n\t\t\t\tflip={this.iconFlip}\n\t\t\t\trotate={this.iconRotate}\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
@@ -3,7 +3,7 @@ import { d as defineCustomElement$3 } from './button.component.js';
|
|
|
3
3
|
import { d as defineCustomElement$2 } from './icon.component.js';
|
|
4
4
|
import { d as defineCustomElement$1 } from './loader.component.js';
|
|
5
5
|
|
|
6
|
-
const drawerHeaderComponentCss = ".absolute{position:absolute!important}.sticky{position:sticky!important}.top-0{top:0!important}.flex{display:flex!important}.
|
|
6
|
+
const drawerHeaderComponentCss = ".absolute{position:absolute!important}.sticky{position:sticky!important}.top-0{top:0!important}.z-drawer-header{z-index:501!important}.flex{display:flex!important}.items-center{align-items:center!important}.border-0{border-width:0!important}.border-b{border-bottom-width:1px!important}.border-solid{border-style:solid!important}.border-b-mystic-dark{--tw-border-opacity:1!important;border-bottom-color:rgb(218 230 240/var(--tw-border-opacity))!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.font-semibold{font-weight:600!important}*{box-sizing:border-box}:host{--tw-bg-opacity:1;--tw-text-opacity:1;--tw-border-opacity:1!important;align-items:center;background-color:rgb(255 255 255/var(--tw-bg-opacity));border-width:0!important;border-bottom:1px rgb(218 230 240/var(--tw-border-opacity))!important;border-style:solid!important;color:rgb(39 40 56/var(--tw-text-opacity));display:flex;font-size:1.25rem;font-weight:600;justify-content:center;line-height:1.75rem;padding:calc(env(safe-area-inset-top, 0) + 1rem) 1rem 1rem;position:sticky;top:0;z-index:501}:host p-button{left:1rem;position:absolute;top:calc(env(safe-area-inset-top, 0) + 1rem)}.static{position:static!important}";
|
|
7
7
|
|
|
8
8
|
const ModalHeader = /*@__PURE__*/ proxyCustomElement(class ModalHeader extends HTMLElement {
|
|
9
9
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"drawer-header.component.js","mappings":";;;;;AAAA,MAAM,wBAAwB,GAAG,
|
|
1
|
+
{"file":"drawer-header.component.js","mappings":";;;;;AAAA,MAAM,wBAAwB,GAAG,0rCAA0rC;;MCO9sC,WAAW;;;;;;qBAIH,IAAI;;EAUxB,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAC,iBAAiB,IAC3B,IAAI,CAAC,SAAS,KACd,gBACC,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,UAAU,EACf,QAAQ,EAAE,IAAI,EACd,OAAO,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAChC,IAAI,EAAC,OAAO,GACD,CACZ,EAED,eAAQ,CACF,EACN;GACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/atoms/drawer-header/drawer-header.component.scss?tag=p-drawer-header&encapsulation=shadow","src/components/atoms/drawer-header/drawer-header.component.tsx"],"sourcesContent":[":host {\n\t@apply bg-white;\n\t@apply sticky top-0 flex items-center justify-center;\n\t@apply z-drawer-header p-4;\n\n\tpadding-top: calc(env(safe-area-inset-top, 0) + 1rem);\n\n\t@apply text-xl font-semibold text-storm-dark;\n\n\t@apply border-0 border-b border-solid border-b-mystic-dark #{!important};\n\n\tp-button {\n\t\t@apply absolute left-4;\n\n\t\ttop: calc(env(safe-area-inset-top, 0) + 1rem);\n\t}\n}\n","import { Component, Event, EventEmitter, h, Host, Prop } from '@stencil/core';\n\n@Component({\n\ttag: 'p-drawer-header',\n\tstyleUrl: 'drawer-header.component.scss',\n\tshadow: true,\n})\nexport class ModalHeader {\n\t/**\n\t * Wether to show the close button on mobile\n\t */\n\t@Prop() showClose = true;\n\n\t/**\n\t * Close click event\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tclose: EventEmitter<MouseEvent>;\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class=\"p-drawer-header\">\n\t\t\t\t{this.showClose && (\n\t\t\t\t\t<p-button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\ticon=\"negative\"\n\t\t\t\t\t\ticonOnly={true}\n\t\t\t\t\t\tonClick={() => this.close.emit()}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t></p-button>\n\t\t\t\t)}\n\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const modalContainerComponentCss = ".flex{display:flex!important}.w-full{width:100%!important}.animate-slide-in-bottom{animation:slideInBottom .5s ease forwards!important}.animate-slide-out-bottom{animation:slideOutBottom .5s ease forwards!important}.flex-col{flex-direction:column!important}.rounded-b-none{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.rounded-t-xxlarge{border-top-left-radius:.75rem!important;border-top-right-radius:.75rem!important}.shadow-4{--tw-shadow:0px 0.3125rem 1rem rgba(0,24,98,.08),0px 0.0625rem 0.1875rem rgba(0,24,98,.13)!important;--tw-shadow-colored:0px 0.3125rem 1rem var(--tw-shadow-color),0px 0.0625rem 0.1875rem var(--tw-shadow-color)!important;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important}*{box-sizing:border-box}p-modal-container{--tw-shadow:0px 0.3125rem 1rem rgba(0,24,98,.08),0px 0.0625rem 0.1875rem rgba(0,24,98,.13)!important;--tw-shadow-colored:0px 0.3125rem 1rem var(--tw-shadow-color),0px 0.0625rem 0.1875rem var(--tw-shadow-color)!important;animation:slideInBottom .5s ease forwards!important;border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:.75rem;border-top-right-radius:.75rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important;display:flex;flex-direction:column;width:100%;z-index:600}@media (min-width:40rem){p-modal-container{width:auto}}@media (min-width:64rem){p-modal-container{animation:slideInBottomSmall .5s ease forwards!important;border-bottom-left-radius:.75rem;border-bottom-right-radius:.75rem;margin:auto}}@keyframes slideInBottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideOutBottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}p-modal-container.closing{animation:slideOutBottom .5s ease forwards!important}@media (min-width:64rem){p-modal-container.closing{animation:slideOutBottomSmall .5s ease forwards!important}
|
|
3
|
+
const modalContainerComponentCss = ".z-modal{z-index:600!important}.flex{display:flex!important}.max-h-\\[calc\\(100dvh-4rem\\)\\]{max-height:calc(100dvh - 4rem)!important}.w-full{width:100%!important}.animate-slide-in-bottom{animation:slideInBottom .5s ease forwards!important}.animate-slide-out-bottom{animation:slideOutBottom .5s ease forwards!important}.flex-col{flex-direction:column!important}.rounded-b-none{border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}.rounded-t-xxlarge{border-top-left-radius:.75rem!important;border-top-right-radius:.75rem!important}.shadow-4{--tw-shadow:0px 0.3125rem 1rem rgba(0,24,98,.08),0px 0.0625rem 0.1875rem rgba(0,24,98,.13)!important;--tw-shadow-colored:0px 0.3125rem 1rem var(--tw-shadow-color),0px 0.0625rem 0.1875rem var(--tw-shadow-color)!important;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important}*{box-sizing:border-box}p-modal-container{--tw-shadow:0px 0.3125rem 1rem rgba(0,24,98,.08),0px 0.0625rem 0.1875rem rgba(0,24,98,.13)!important;--tw-shadow-colored:0px 0.3125rem 1rem var(--tw-shadow-color),0px 0.0625rem 0.1875rem var(--tw-shadow-color)!important;animation:slideInBottom .5s ease forwards!important;border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:.75rem;border-top-right-radius:.75rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important;display:flex;flex-direction:column;max-height:calc(100dvh - 4rem);width:100%;z-index:600}@media (min-width:40rem){p-modal-container{width:auto}}@media (min-width:64rem){p-modal-container{animation:slideInBottomSmall .5s ease forwards!important;border-bottom-left-radius:.75rem;border-bottom-right-radius:.75rem;margin:auto;max-height:none}}@keyframes slideInBottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideOutBottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}p-modal-container.closing{animation:slideOutBottom .5s ease forwards!important}@media (min-width:64rem){p-modal-container.closing{animation:slideOutBottomSmall .5s ease forwards!important}@keyframes slideInBottomSmall{0%{transform:translateY(20%)}to{transform:translateY(0)}}.desktop-xs\\:animate-slide-in-bottom-small{animation:slideInBottomSmall .5s ease forwards!important}@keyframes slideOutBottomSmall{0%{transform:translateY(0)}to{transform:translateY(20%)}}.desktop-xs\\:animate-slide-out-bottom-small{animation:slideOutBottomSmall .5s ease forwards!important}}.static{position:static!important}@media (min-width:40rem){.tablet\\:w-80{width:20rem!important}.tablet\\:w-\\[33\\.5rem\\]{width:33.5rem!important}.tablet\\:w-\\[38rem\\]{width:38rem!important}.tablet\\:w-\\[47\\.5rem\\]{width:47.5rem!important}.tablet\\:w-\\[57\\.5rem\\]{width:57.5rem!important}}";
|
|
4
4
|
|
|
5
5
|
// $modal-xs: 20rem;
|
|
6
6
|
// $modal-sm: 33.5rem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"modal-container.component.js","mappings":";;AAAA,MAAM,0BAA0B,GAAG,
|
|
1
|
+
{"file":"modal-container.component.js","mappings":";;AAAA,MAAM,0BAA0B,GAAG,4vFAA4vF;;ACE/xF;AACA;AACA;AACA;AACA;AAEA,MAAM,UAAU,GAAG;EAClB,EAAE,EAAE,aAAa;EACjB,EAAE,EAAE,oBAAoB;EACxB,EAAE,EAAE,kBAAkB;EACtB,EAAE,EAAE,oBAAoB;EACxB,EAAE,EAAE,oBAAoB;CACxB,CAAC;MAKW,cAAc;;;;gBAIgB,IAAI;mBAKnB,KAAK;;EAEhC,MAAM;IACL,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAExC,QACC,EAAC,IAAI,IACJ,KAAK,EAAE,qBACN,IAAI,CAAC,OAAO,IAAI,SACjB,IAAI,SAAS,EAAE,IAEf,eAAQ,CACF,EACN;GACF;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/atoms/modal-container/modal-container.component.scss?tag=p-modal-container","src/components/atoms/modal-container/modal-container.component.tsx"],"sourcesContent":["p-modal-container {\n\t@apply z-modal flex w-full flex-col tablet:w-auto;\n\t@apply rounded-b-none rounded-t-xxlarge desktop-xs:rounded-b-xxlarge;\n\n\t@apply desktop-xs:m-auto;\n\t@apply max-h-[calc(100dvh-4rem)] desktop-xs:max-h-none;\n\n\t@apply animate-slide-in-bottom desktop-xs:animate-slide-in-bottom-small #{!important};\n\n\t@apply shadow-4 #{!important};\n\n\t&.closing {\n\t\t@apply animate-slide-out-bottom desktop-xs:animate-slide-out-bottom-small #{!important};\n\t}\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\n\n// $modal-xs: 20rem;\n// $modal-sm: 33.5rem;\n// $modal-md: 38rem;\n// $modal-lg: 47.5rem;\n// $modal-xl: 57.5rem;\n\nconst modalSizes = {\n\txs: 'tablet:w-80',\n\tsm: 'tablet:w-[33.5rem]',\n\tmd: 'tablet:w-[38rem]',\n\tlg: 'tablet:w-[47.5rem]',\n\txl: 'tablet:w-[57.5rem]',\n};\n@Component({\n\ttag: 'p-modal-container',\n\tstyleUrl: 'modal-container.component.scss',\n})\nexport class ModalContainer {\n\t/**\n\t * The size of the modal container\n\t */\n\t@Prop() size: 'sm' | 'md' | 'lg' | 'xl' = 'md';\n\n\t/**\n\t * Wether the container is closing\n\t */\n\t@Prop() closing: boolean = false;\n\n\trender() {\n\t\tconst sizeClass = modalSizes[this.size];\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={`p-modal-container ${\n\t\t\t\t\tthis.closing && 'closing'\n\t\t\t\t} ${sizeClass}`}\n\t\t\t>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PButtonGroup extends Components.PButtonGroup, HTMLElement {}
|
|
4
|
+
export const PButtonGroup: {
|
|
5
|
+
prototype: PButtonGroup;
|
|
6
|
+
new (): PButtonGroup;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const ButtonGroup = /*@__PURE__*/ proxyCustomElement(class ButtonGroup extends HTMLElement {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.__registerHost();
|
|
7
|
+
this.__attachShadow();
|
|
8
|
+
this.size = 'medium';
|
|
9
|
+
}
|
|
10
|
+
componentWillLoad() {
|
|
11
|
+
this._checkButtons();
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (h(Host, { class: 'p-button-group flex items-center' }, h("slot", null)));
|
|
15
|
+
}
|
|
16
|
+
slotchange() {
|
|
17
|
+
this._checkButtons();
|
|
18
|
+
}
|
|
19
|
+
_checkButtons() {
|
|
20
|
+
const buttons = Array.from(this._el.querySelectorAll(':scope > p-button'));
|
|
21
|
+
for (let i = 0; i < buttons.length; i++) {
|
|
22
|
+
const button = buttons[i];
|
|
23
|
+
button.size = this.size;
|
|
24
|
+
// first
|
|
25
|
+
if (i === 0) {
|
|
26
|
+
button.buttonGroupPosition = 'start';
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
// last
|
|
30
|
+
if (i === buttons.length - 1) {
|
|
31
|
+
button.buttonGroupPosition = 'end';
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
// rest
|
|
35
|
+
button.buttonGroupPosition = 'middle';
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
get _el() { return this; }
|
|
39
|
+
}, [1, "p-button-group", {
|
|
40
|
+
"size": [1]
|
|
41
|
+
}, [[0, "slotchange", "slotchange"]]]);
|
|
42
|
+
function defineCustomElement$1() {
|
|
43
|
+
if (typeof customElements === "undefined") {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const components = ["p-button-group"];
|
|
47
|
+
components.forEach(tagName => { switch (tagName) {
|
|
48
|
+
case "p-button-group":
|
|
49
|
+
if (!customElements.get(tagName)) {
|
|
50
|
+
customElements.define(tagName, ButtonGroup);
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
} });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const PButtonGroup = ButtonGroup;
|
|
57
|
+
const defineCustomElement = defineCustomElement$1;
|
|
58
|
+
|
|
59
|
+
export { PButtonGroup, defineCustomElement };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=p-button-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"p-button-group.js","mappings":";;MAOa,WAAW;;;;;gBAIY,QAAQ;;EAO3C,iBAAiB;IAChB,IAAI,CAAC,aAAa,EAAE,CAAC;GACrB;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAC,kCAAkC,IAC7C,eAAQ,CACF,EACN;GACF;EAGD,UAAU;IACT,IAAI,CAAC,aAAa,EAAE,CAAC;GACrB;EAEO,aAAa;IACpB,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CACzB,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAC3B,CAAC;IAErB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MACxC,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;MAE1B,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;;MAGxB,IAAI,CAAC,KAAK,CAAC,EAAE;QACZ,MAAM,CAAC,mBAAmB,GAAG,OAAO,CAAC;QACrC,SAAS;OACT;;MAGD,IAAI,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QAC7B,MAAM,CAAC,mBAAmB,GAAG,KAAK,CAAC;QACnC,SAAS;OACT;;MAGD,MAAM,CAAC,mBAAmB,GAAG,QAAQ,CAAC;KACtC;GACD;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/button-group/button-group.component.tsx"],"sourcesContent":["import { Component, Element, h, Host, Listen, Prop } from '@stencil/core';\nimport { Button } from '../../atoms/button/button.component';\n\n@Component({\n\ttag: 'p-button-group',\n\tshadow: true,\n})\nexport class ButtonGroup {\n\t/**\n\t * The size of the child buttons\n\t */\n\t@Prop() size: 'medium' | 'small' = 'medium';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\tcomponentWillLoad() {\n\t\tthis._checkButtons();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-button-group flex items-center'>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('slotchange')\n\tslotchange() {\n\t\tthis._checkButtons();\n\t}\n\n\tprivate _checkButtons() {\n\t\tconst buttons = Array.from(\n\t\t\tthis._el.querySelectorAll(':scope > p-button')\n\t\t) as any as Button[];\n\n\t\tfor (let i = 0; i < buttons.length; i++) {\n\t\t\tconst button = buttons[i];\n\n\t\t\tbutton.size = this.size;\n\n\t\t\t// first\n\t\t\tif (i === 0) {\n\t\t\t\tbutton.buttonGroupPosition = 'start';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// last\n\t\t\tif (i === buttons.length - 1) {\n\t\t\t\tbutton.buttonGroupPosition = 'end';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// rest\n\t\t\tbutton.buttonGroupPosition = 'middle';\n\t\t}\n\t}\n}\n"],"version":3}
|
|
@@ -2867,7 +2867,7 @@ function cleanEscapedString(input) {
|
|
|
2867
2867
|
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
|
|
2868
2868
|
}
|
|
2869
2869
|
|
|
2870
|
-
const datepickerComponentCss = ".flex{display:flex!important}*{box-sizing:border-box}:host{display:flex;flex-direction:column}:host input.read-only{text-overflow:ellipsis}.static{position:static!important}.cursor-pointer{cursor:pointer!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}";
|
|
2870
|
+
const datepickerComponentCss = ".flex{display:flex!important}*{box-sizing:border-box}:host{display:flex;flex-direction:column}:host input.read-only{text-overflow:ellipsis}.static{position:static!important}.absolute{position:absolute!important}.cursor-pointer{cursor:pointer!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}";
|
|
2871
2871
|
|
|
2872
2872
|
const Datepicker = /*@__PURE__*/ proxyCustomElement(class Datepicker extends HTMLElement {
|
|
2873
2873
|
constructor() {
|
|
@@ -2896,6 +2896,8 @@ const Datepicker = /*@__PURE__*/ proxyCustomElement(class Datepicker extends HTM
|
|
|
2896
2896
|
this.required = undefined;
|
|
2897
2897
|
this.error = undefined;
|
|
2898
2898
|
this.disabled = false;
|
|
2899
|
+
this.strategy = 'absolute';
|
|
2900
|
+
this.placement = 'bottom-start';
|
|
2899
2901
|
this._showDropdown = false;
|
|
2900
2902
|
this._value = undefined;
|
|
2901
2903
|
this._minDate = undefined;
|
|
@@ -2944,13 +2946,13 @@ const Datepicker = /*@__PURE__*/ proxyCustomElement(class Datepicker extends HTM
|
|
|
2944
2946
|
}
|
|
2945
2947
|
// normalize all to date
|
|
2946
2948
|
this._disabledDates = disabledDates
|
|
2947
|
-
.map(
|
|
2949
|
+
.map(date => {
|
|
2948
2950
|
if (typeof date === 'string') {
|
|
2949
2951
|
return new Date(date);
|
|
2950
2952
|
}
|
|
2951
2953
|
return date;
|
|
2952
2954
|
})
|
|
2953
|
-
.filter(
|
|
2955
|
+
.filter(date => isValid(date));
|
|
2954
2956
|
if (this._isDisabledDay(this._value)) {
|
|
2955
2957
|
this._setValue(null);
|
|
2956
2958
|
}
|
|
@@ -2965,14 +2967,13 @@ const Datepicker = /*@__PURE__*/ proxyCustomElement(class Datepicker extends HTM
|
|
|
2965
2967
|
if (this.maxDate) {
|
|
2966
2968
|
this.parseMaxDate(this.maxDate);
|
|
2967
2969
|
}
|
|
2968
|
-
if (this.mode !== 'day' &&
|
|
2969
|
-
this.format === this._defaultFormats['day']) {
|
|
2970
|
+
if (this.mode !== 'day' && this.format === this._defaultFormats['day']) {
|
|
2970
2971
|
this.format = this._defaultFormats[this.mode];
|
|
2971
2972
|
}
|
|
2972
2973
|
this.parseValue(this.value);
|
|
2973
2974
|
}
|
|
2974
2975
|
render() {
|
|
2975
|
-
return (h(Host, { class:
|
|
2976
|
+
return (h(Host, { class: 'p-datepicker' }, h("p-dropdown", { strategy: this.strategy, placement: this.placement, disableTriggerClick: true, applyMaxWidth: false, applyFullWidth: false, insideClick: true, show: this._showDropdown }, h("p-input-group", { slot: 'trigger', icon: this.hideIconWhenFilled && !!this._value ? null : 'calendar', iconPosition: 'start', size: this.size, prefix: this.prefix, label: this.label, helper: this.helper, required: this.required, error: this.error, disabled: this.disabled, focused: this._showDropdown }, h("input", { slot: 'input', type: 'text', placeholder: this.placeholder, value: this._getFormattedDate(), class: 'p-input cursor-pointer', onFocus: () => this._onFocus(), onBlur: ev => this._onBlur(ev), onInput: ev => this._onInput(ev) })), h("div", { slot: 'items' }, h("p-calendar", { variant: 'embedded', value: this._value, onValueChange: ({ detail }) => (this.value = detail), preselectToday: this.preselectToday, disabledDates: this.disabledDates, minDate: this.minDate, maxDate: this.maxDate, disableWeekends: this.disableWeekends, mode: this.mode })))));
|
|
2976
2977
|
}
|
|
2977
2978
|
documentClickHandler({ target }) {
|
|
2978
2979
|
if (!this._showDropdown || childOf(target, this._el)) {
|
|
@@ -3032,7 +3033,7 @@ const Datepicker = /*@__PURE__*/ proxyCustomElement(class Datepicker extends HTM
|
|
|
3032
3033
|
_isDisabledDay(day) {
|
|
3033
3034
|
return ((isBefore(day, this._minDate) && !isSameDay(day, this._minDate)) ||
|
|
3034
3035
|
(isAfter(day, this._maxDate) && !isSameDay(day, this._maxDate)) ||
|
|
3035
|
-
this._disabledDates.findIndex(
|
|
3036
|
+
this._disabledDates.findIndex(date => isSameDay(date, day)) >= 0);
|
|
3036
3037
|
}
|
|
3037
3038
|
_getFormattedDate() {
|
|
3038
3039
|
if (!this._value) {
|
|
@@ -3066,6 +3067,8 @@ const Datepicker = /*@__PURE__*/ proxyCustomElement(class Datepicker extends HTM
|
|
|
3066
3067
|
"required": [516],
|
|
3067
3068
|
"error": [513],
|
|
3068
3069
|
"disabled": [516],
|
|
3070
|
+
"strategy": [1],
|
|
3071
|
+
"placement": [513],
|
|
3069
3072
|
"_showDropdown": [32],
|
|
3070
3073
|
"_value": [32],
|
|
3071
3074
|
"_minDate": [32],
|