@leaflink/stash 44.0.0-beta.4 → 44.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ActionsDropdown.js +8 -8
- package/dist/ActionsDropdown.js.map +1 -1
- package/dist/AddressSelect.js +2 -2
- package/dist/CurrencyInput.js +2 -2
- package/dist/DataViewFilters.js +2 -2
- package/dist/DatePicker.js +2 -2
- package/dist/Field.js +2 -2
- package/dist/{Field.vue_vue_type_script_setup_true_lang-42cf79d4.js → Field.vue_vue_type_script_setup_true_lang-4483019d.js} +2 -2
- package/dist/{Field.vue_vue_type_script_setup_true_lang-42cf79d4.js.map → Field.vue_vue_type_script_setup_true_lang-4483019d.js.map} +1 -1
- package/dist/FileUpload.js +12 -12
- package/dist/FileUpload.js.map +1 -1
- package/dist/FilterSelect.js +2 -2
- package/dist/Filters.js +2 -2
- package/dist/InlineEdit.js +2 -2
- package/dist/Input.js +2 -2
- package/dist/InputOptions.js +2 -2
- package/dist/Label.js +1 -1
- package/dist/{Label.vue_vue_type_script_setup_true_lang-c5589919.js → Label.vue_vue_type_script_setup_true_lang-2de35913.js} +6 -6
- package/dist/{Label.vue_vue_type_script_setup_true_lang-c5589919.js.map → Label.vue_vue_type_script_setup_true_lang-2de35913.js.map} +1 -1
- package/dist/ListView.js +8 -8
- package/dist/ListView.js.map +1 -1
- package/dist/RadioGroup.js +44 -44
- package/dist/RadioGroup.js.map +1 -1
- package/dist/RadioNew.js +2 -2
- package/dist/SearchBar.js +2 -2
- package/dist/Select.js +2 -2
- package/dist/SelectStatus.js +2 -2
- package/dist/Textarea.js +2 -2
- package/dist/components.css +1 -1
- package/package.json +1 -1
package/dist/ActionsDropdown.js
CHANGED
|
@@ -26,22 +26,22 @@ const y = /* @__PURE__ */ c({
|
|
|
26
26
|
buttonText: { default: () => C("ll.actions") }
|
|
27
27
|
},
|
|
28
28
|
setup(l) {
|
|
29
|
-
const
|
|
29
|
+
const t = l, o = p();
|
|
30
30
|
return (d, N) => (m(), u(x, {
|
|
31
|
-
align:
|
|
32
|
-
"content-class": [n(
|
|
33
|
-
class: s(n(
|
|
31
|
+
align: t.align,
|
|
32
|
+
"content-class": [n(o).dropdownContent, t.contentClass],
|
|
33
|
+
class: s(n(o).actionsDropdown)
|
|
34
34
|
}, f({
|
|
35
35
|
toggle: e(({ isActive: r, toggle: i }) => [
|
|
36
36
|
a(g, {
|
|
37
|
-
class: s(["button align-middle align-justify
|
|
37
|
+
class: s(["button align-middle align-justify tw-flex tw-w-full tw-border tw-border-blue-500 tw-text-blue-500", [n(o).actionButton, { [n(o).disabled]: t.disabled }]]),
|
|
38
38
|
secondary: "",
|
|
39
39
|
"aria-expanded": r.toString(),
|
|
40
|
-
disabled:
|
|
40
|
+
disabled: t.disabled,
|
|
41
41
|
onClick: i
|
|
42
42
|
}, {
|
|
43
43
|
default: e(() => [
|
|
44
|
-
_(w(
|
|
44
|
+
_(w(t.buttonText) + " ", 1),
|
|
45
45
|
a(B, {
|
|
46
46
|
class: "tw-ml-1.5",
|
|
47
47
|
name: "caret-down"
|
|
@@ -52,7 +52,7 @@ const y = /* @__PURE__ */ c({
|
|
|
52
52
|
]),
|
|
53
53
|
_: 2
|
|
54
54
|
}, [
|
|
55
|
-
|
|
55
|
+
t.disabled ? void 0 : {
|
|
56
56
|
name: "default",
|
|
57
57
|
fn: e(() => [
|
|
58
58
|
b(d.$slots, "default")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsDropdown.js","sources":["../src/components/ActionsDropdown/ActionsDropdown.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { useCssModule } from 'vue';\n\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Dropdown from '../Dropdown/Dropdown.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({\n name: 'll-actions-dropdown',\n });\n\n export interface ActionsDropdownProps {\n /**\n * Used to position the dropdown relative to target\n * Options: left, right\n */\n align?: 'left' | 'right';\n /**\n * Indicates whether the trigger button is disabled or not\n */\n disabled?: boolean;\n /**\n * Class to be applied to the dropdown content\n */\n contentClass?: string;\n /**\n * Text to be displayed on the trigger button\n */\n buttonText?: string;\n }\n\n const props = withDefaults(defineProps<ActionsDropdownProps>(), {\n align: 'left',\n disabled: false,\n contentClass: '',\n buttonText: () => t('ll.actions'),\n });\n\n const classes = useCssModule();\n</script>\n\n<template>\n <Dropdown\n :align=\"props.align\"\n :content-class=\"[classes.dropdownContent, props.contentClass]\"\n :class=\"classes.actionsDropdown\"\n >\n <template #toggle=\"{ isActive, toggle }\">\n <Button\n class=\"button align-middle align-justify
|
|
1
|
+
{"version":3,"file":"ActionsDropdown.js","sources":["../src/components/ActionsDropdown/ActionsDropdown.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { useCssModule } from 'vue';\n\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Dropdown from '../Dropdown/Dropdown.vue';\n import Icon from '../Icon/Icon.vue';\n\n defineOptions({\n name: 'll-actions-dropdown',\n });\n\n export interface ActionsDropdownProps {\n /**\n * Used to position the dropdown relative to target\n * Options: left, right\n */\n align?: 'left' | 'right';\n /**\n * Indicates whether the trigger button is disabled or not\n */\n disabled?: boolean;\n /**\n * Class to be applied to the dropdown content\n */\n contentClass?: string;\n /**\n * Text to be displayed on the trigger button\n */\n buttonText?: string;\n }\n\n const props = withDefaults(defineProps<ActionsDropdownProps>(), {\n align: 'left',\n disabled: false,\n contentClass: '',\n buttonText: () => t('ll.actions'),\n });\n\n const classes = useCssModule();\n</script>\n\n<template>\n <Dropdown\n :align=\"props.align\"\n :content-class=\"[classes.dropdownContent, props.contentClass]\"\n :class=\"classes.actionsDropdown\"\n >\n <template #toggle=\"{ isActive, toggle }\">\n <Button\n class=\"button align-middle align-justify tw-flex tw-w-full tw-border tw-border-blue-500 tw-text-blue-500\"\n secondary\n :aria-expanded=\"isActive.toString()\"\n :class=\"[classes.actionButton, { [classes.disabled]: props.disabled }]\"\n :disabled=\"props.disabled\"\n @click=\"toggle\"\n >\n {{ props.buttonText }} <Icon class=\"tw-ml-1.5\" name=\"caret-down\" />\n </Button>\n </template>\n\n <template v-if=\"!props.disabled\" #default>\n <!-- @slot Dropdown content -->\n <slot></slot>\n </template>\n </Dropdown>\n</template>\n\n<style module>\n .actionButton {\n min-width: 156px;\n white-space: normal;\n }\n\n .actionButton:hover {\n background-color: var(--color-blue-100);\n border-color: var(--color-blue-500) !important;\n }\n\n .disabled {\n background-color: var(--color-ice-100) !important;\n border-color: var(--color-ice-500) !important;\n color: var(--color-ice-500) !important;\n }\n\n .dropdownContent {\n margin-top: 4px;\n }\n\n .dropdownContent:global(.dropdown__content) {\n margin-left: 0;\n margin-right: 0;\n max-width: 90vw;\n }\n\n .dropdownContent:global(.dropdown__content)::after {\n display: none;\n }\n\n @media screen(md) {\n .actionsDropdown {\n min-width: 156px;\n }\n\n .dropdownContent:global(.dropdown__content) {\n min-width: 156px;\n }\n }\n</style>\n"],"names":["classes","useCssModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuCQA,IAAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/AddressSelect.js
CHANGED
|
@@ -24,8 +24,8 @@ import "./Icon.js";
|
|
|
24
24
|
import "./index-79ce320f.js";
|
|
25
25
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
26
26
|
import "./_plugin-vue_export-helper-dad06003.js";
|
|
27
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
28
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
27
|
+
import "./Field.vue_vue_type_script_setup_true_lang-4483019d.js";
|
|
28
|
+
import "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
29
29
|
import "./locale.js";
|
|
30
30
|
const _ = "address-select-", ve = /* @__PURE__ */ M({
|
|
31
31
|
__name: "AddressSelect",
|
package/dist/CurrencyInput.js
CHANGED
|
@@ -6,9 +6,9 @@ import "./utils/i18n.js";
|
|
|
6
6
|
import "./constants.js";
|
|
7
7
|
import "./locale.js";
|
|
8
8
|
import "lodash-es/get";
|
|
9
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
9
|
+
import "./Field.vue_vue_type_script_setup_true_lang-4483019d.js";
|
|
10
10
|
import "lodash-es/uniqueId";
|
|
11
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
11
|
+
import "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
12
12
|
import "./Icon.js";
|
|
13
13
|
import "./index-79ce320f.js";
|
|
14
14
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
package/dist/DataViewFilters.js
CHANGED
|
@@ -9,7 +9,7 @@ import $ from "./Icon.js";
|
|
|
9
9
|
import "./Paginate.vue_used_vue_type_style_index_0_lang.module-1a2084f9.js";
|
|
10
10
|
import { D as G } from "./DataView.vue_used_vue_type_style_index_0_lang.module-d878ca9a.js";
|
|
11
11
|
import q from "./FilterChip.js";
|
|
12
|
-
import { _ as H } from "./Label.vue_vue_type_script_setup_true_lang-
|
|
12
|
+
import { _ as H } from "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
13
13
|
import K from "./Modal.js";
|
|
14
14
|
import X from "./SearchBar.js";
|
|
15
15
|
import { D as Y } from "./DataViewFilters.keys-c80ffabe.js";
|
|
@@ -26,7 +26,7 @@ import "./Backdrop.js";
|
|
|
26
26
|
import "./Input.js";
|
|
27
27
|
import "lodash-es/isNil";
|
|
28
28
|
import "./utils/i18n.js";
|
|
29
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
29
|
+
import "./Field.vue_vue_type_script_setup_true_lang-4483019d.js";
|
|
30
30
|
function Pe({
|
|
31
31
|
schema: a,
|
|
32
32
|
dataViewRef: w
|
package/dist/DatePicker.js
CHANGED
|
@@ -20,8 +20,8 @@ import "./index-79ce320f.js";
|
|
|
20
20
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
21
21
|
import "lodash-es/isNil";
|
|
22
22
|
import "./utils/i18n.js";
|
|
23
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
24
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
23
|
+
import "./Field.vue_vue_type_script_setup_true_lang-4483019d.js";
|
|
24
|
+
import "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
25
25
|
function Uf(e, t) {
|
|
26
26
|
he(2, arguments);
|
|
27
27
|
var r = ge(e).getTime(), n = je(t);
|
package/dist/Field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as o } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _ as o } from "./Field.vue_vue_type_script_setup_true_lang-4483019d.js";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "lodash-es/uniqueId";
|
|
4
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
5
5
|
import "./locale.js";
|
|
6
6
|
import "lodash-es/get";
|
|
7
7
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as x, useAttrs as k, useSlots as T, computed as a, openBlock as l, createBlock as m, resolveDynamicComponent as B, mergeProps as O, unref as f, withCtx as v, normalizeClass as R, createTextVNode as q, toDisplayString as p, createCommentVNode as s, createElementBlock as o, renderSlot as c } from "vue";
|
|
2
2
|
import h from "lodash-es/uniqueId";
|
|
3
|
-
import { _ as E } from "./Label.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { _ as E } from "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
4
4
|
const L = ["aria-labelledby"], S = ["id"], C = {
|
|
5
5
|
key: 4,
|
|
6
6
|
class: "tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs",
|
|
@@ -93,4 +93,4 @@ const L = ["aria-labelledby"], S = ["id"], C = {
|
|
|
93
93
|
export {
|
|
94
94
|
z as _
|
|
95
95
|
};
|
|
96
|
-
//# sourceMappingURL=Field.vue_vue_type_script_setup_true_lang-
|
|
96
|
+
//# sourceMappingURL=Field.vue_vue_type_script_setup_true_lang-4483019d.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"Field.vue_vue_type_script_setup_true_lang-4483019d.js","sources":["../src/components/Field/Field.vue"],"sourcesContent":["<script lang=\"ts\">\n export default {\n inheritAttrs: false,\n };\n</script>\n\n<script setup lang=\"ts\">\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, useAttrs, useSlots } from 'vue';\n\n import Label from '../Label/Label.vue';\n\n export interface FieldProps {\n /**\n * Adds spacing under the field that is consistent whether or not hint/error text is displayed.\n */\n addBottomSpace?: boolean;\n\n /**\n * Error text to display. Replaces `hintText` (if provided) & adds error styling.\n */\n errorText?: string;\n\n /**\n * Displays text below the input; hidden when the isReadOnly prop is truthy.\n */\n hintText?: string;\n\n /**\n * ID for the Label and Input; must be unique\n */\n id?: string;\n\n /**\n * ID for the error text element; useful for aria-errormessage\n */\n errorId?: string;\n\n /**\n * Whether it's a readonly field.\n */\n isReadOnly?: boolean;\n\n /**\n * Whether the field is required.\n */\n isRequired?: boolean;\n\n /**\n * Label to render above the input.\n */\n label?: string;\n\n /**\n * Show \"(optional)\" to the right of the label text\n */\n showOptionalInLabel?: boolean;\n\n /**\n * Indicates wheter the field is a fieldset or not\n */\n fieldset?: boolean;\n }\n\n const props = withDefaults(defineProps<FieldProps>(), {\n addBottomSpace: false,\n errorText: undefined,\n hintText: undefined,\n id: undefined,\n errorId: undefined,\n isRequired: false,\n label: undefined,\n showOptionalInLabel: false,\n fieldset: false,\n });\n const attrs = useAttrs();\n const slots = useSlots();\n const fieldId = computed(() => props.id || uniqueId('field-'));\n const fieldErrorId = computed(() => props.errorId || uniqueId('field-error-'));\n const labelId = computed(() => uniqueId('field-label-'));\n const hasError = computed(() => !!props.errorText);\n const wrapperElement = computed(() => (props.fieldset ? 'fieldset' : 'div'));\n\n // Any attributes that are unique to form elements, you want to exclude from\n // being bound from the root element.\n const rootAttrs = computed(() => {\n const { placeholder, ...otherAttrs } = attrs;\n\n return otherAttrs;\n });\n</script>\n\n<template>\n <component\n v-bind=\"rootAttrs\"\n :is=\"wrapperElement\"\n :class=\"[\n { 'tw-p-0': props.fieldset },\n { 'tw-mb-9': props.addBottomSpace && !props.errorText && !props.hintText && !slots.hint },\n { 'tw-mb-4': props.addBottomSpace && (props.errorText || props.hintText || slots.hint) },\n ]\"\n >\n <Label\n v-if=\"props.label\"\n :id=\"labelId\"\n :class=\"{ 'tw-mb-1.5': !!props.isReadOnly }\"\n :for=\"fieldId\"\n :has-error=\"hasError\"\n :is-required=\"isRequired\"\n :show-optional=\"props.showOptionalInLabel\"\n :legend=\"props.fieldset\"\n >\n {{ props.label }}\n </Label>\n\n <!-- @slot for the form field; the Label can also be rendered here instead of using the label prop -->\n <template v-if=\"props.isReadOnly\">\n <div :aria-labelledby=\"labelId\">\n <slot\n :field-id=\"fieldId\"\n :field-error-id=\"fieldErrorId\"\n :has-error=\"hasError\"\n :is-required=\"isRequired\"\n :label-id=\"labelId\"\n :show-optional-in-label=\"props.showOptionalInLabel\"\n ></slot>\n </div>\n </template>\n <template v-else>\n <slot\n :field-id=\"fieldId\"\n :field-error-id=\"fieldErrorId\"\n :has-error=\"hasError\"\n :is-required=\"isRequired\"\n :label-id=\"labelId\"\n :show-optional-in-label=\"props.showOptionalInLabel\"\n ></slot>\n </template>\n\n <span\n v-if=\"props.errorText\"\n :id=\"fieldErrorId\"\n class=\"tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs tw-text-red-500\"\n data-test=\"field-error\"\n >\n {{ props.errorText }}\n </span>\n\n <span v-else-if=\"props.hintText\" class=\"tw-mt-1 tw-block tw-whitespace-pre-line tw-text-xs\" data-test=\"field-hint\">\n <span v-if=\"!props.isReadOnly\">{{ props.hintText }}</span>\n </span>\n\n <div v-else-if=\"slots.hint\" class=\"tw-mt-1 tw-whitespace-pre-line tw-text-xs\" data-test=\"field-hint\">\n <!-- @slot for displaying hint text below the field -->\n <slot v-if=\"!props.isReadOnly\" name=\"hint\"></slot>\n </div>\n </component>\n</template>\n"],"names":["attrs","useAttrs","slots","useSlots","fieldId","computed","props","uniqueId","fieldErrorId","labelId","hasError","wrapperElement","rootAttrs","placeholder","otherAttrs"],"mappings":";;;;;;;;;;;OACiB;AAAA,EACb,cAAc;AAChB;;;;;;;;;;;;;;;;iBAwEMA,IAAQC,KACRC,IAAQC,KACRC,IAAUC,EAAS,MAAMC,EAAM,MAAMC,EAAS,QAAQ,CAAC,GACvDC,IAAeH,EAAS,MAAMC,EAAM,WAAWC,EAAS,cAAc,CAAC,GACvEE,IAAUJ,EAAS,MAAME,EAAS,cAAc,CAAC,GACjDG,IAAWL,EAAS,MAAM,CAAC,CAACC,EAAM,SAAS,GAC3CK,IAAiBN,EAAS,MAAOC,EAAM,WAAW,aAAa,KAAM,GAIrEM,IAAYP,EAAS,MAAM;AAC/B,YAAM,EAAE,aAAAQ,GAAa,GAAGC,EAAA,IAAed;AAEhC,aAAAc;AAAA,IAAA,CACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/FileUpload.js
CHANGED
|
@@ -2,7 +2,7 @@ import { I } from "./index-79ce320f.js";
|
|
|
2
2
|
import { t as u } from "./locale.js";
|
|
3
3
|
import x from "./Button.js";
|
|
4
4
|
import F from "./Icon.js";
|
|
5
|
-
import { resolveComponent as g, openBlock as r, createElementBlock as o, normalizeClass as d, createVNode as h, withModifiers as c, withCtx as T, createTextVNode as y, toDisplayString as p, createElementVNode as f, Fragment as v, createBlock as O, createCommentVNode as S, renderSlot as
|
|
5
|
+
import { resolveComponent as g, openBlock as r, createElementBlock as o, normalizeClass as d, createVNode as h, withModifiers as c, withCtx as T, createTextVNode as y, toDisplayString as p, createElementVNode as f, Fragment as v, createBlock as O, createCommentVNode as S, renderSlot as w, renderList as C, withDirectives as U, mergeProps as M, vShow as N } from "vue";
|
|
6
6
|
import { _ as P } from "./_plugin-vue_export-helper-dad06003.js";
|
|
7
7
|
import "lodash-es/get";
|
|
8
8
|
import "./Button.vue_used_vue_type_style_index_0_lang.module-b2ee90e6.js";
|
|
@@ -52,7 +52,7 @@ const A = "_button_oi2f6_201", L = {
|
|
|
52
52
|
MIME_TYPES: ["application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
|
|
53
53
|
ILLUSTRATION: "csv"
|
|
54
54
|
}
|
|
55
|
-
}),
|
|
55
|
+
}), _ = Object.freeze({
|
|
56
56
|
Dense: "dense",
|
|
57
57
|
Standard: "standard"
|
|
58
58
|
}), k = {
|
|
@@ -97,13 +97,13 @@ const A = "_button_oi2f6_201", L = {
|
|
|
97
97
|
size: {
|
|
98
98
|
type: String,
|
|
99
99
|
default: "standard",
|
|
100
|
-
validator: (e) => Object.values(
|
|
100
|
+
validator: (e) => Object.values(_).includes(e)
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
emits: ["file-select", "file-delete", "file-error"],
|
|
104
104
|
setup() {
|
|
105
105
|
return {
|
|
106
|
-
Sizes:
|
|
106
|
+
Sizes: _
|
|
107
107
|
};
|
|
108
108
|
},
|
|
109
109
|
data() {
|
|
@@ -215,12 +215,12 @@ const A = "_button_oi2f6_201", L = {
|
|
|
215
215
|
return e.concat(t);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
}, z = ["data-test"], R = { key: 0 }, j = { class: "text-ice-900" }, X = {
|
|
218
|
+
}, z = ["data-test"], R = { key: 0 }, j = { class: "tw-text-ice-900" }, X = {
|
|
219
219
|
key: 0,
|
|
220
|
-
class: "text-small
|
|
220
|
+
class: "text-small tw-mt-6 tw-text-center tw-text-ice-700"
|
|
221
221
|
}, Y = ["accept", "multiple"];
|
|
222
222
|
function B(e, t, i, a, n, l) {
|
|
223
|
-
const m = g("ll-button"),
|
|
223
|
+
const m = g("ll-button"), b = g("InlineSvg"), D = g("ll-icon");
|
|
224
224
|
return r(), o("div", {
|
|
225
225
|
class: d(e.$attrs.class),
|
|
226
226
|
"data-test": e.$attrs["data-test"]
|
|
@@ -262,7 +262,7 @@ function B(e, t, i, a, n, l) {
|
|
|
262
262
|
_: 2
|
|
263
263
|
}, 1032, ["class", "onClick"])
|
|
264
264
|
]))), 128)) : (r(), o(v, { key: 0 }, [
|
|
265
|
-
i.size !== a.Sizes.Dense ? (r(), O(
|
|
265
|
+
i.size !== a.Sizes.Dense ? (r(), O(b, {
|
|
266
266
|
key: 0,
|
|
267
267
|
src: l.illustrationPath,
|
|
268
268
|
name: "file",
|
|
@@ -271,7 +271,7 @@ function B(e, t, i, a, n, l) {
|
|
|
271
271
|
}, null, 8, ["src"])) : S("", !0),
|
|
272
272
|
f("span", j, p(n.fileUploadDragDropFileHereText), 1),
|
|
273
273
|
f("span", {
|
|
274
|
-
class: d(i.size === a.Sizes.Dense ? "md:ml-1 md:mr-2 md:my-0 my-1 text-ice-900" : "tw-mt-1.5 my-1")
|
|
274
|
+
class: d(i.size === a.Sizes.Dense ? "md:ml-1 md:mr-2 md:my-0 my-1 tw-text-ice-900" : "tw-mt-1.5 my-1")
|
|
275
275
|
}, p(n.fileUploadOrText), 3),
|
|
276
276
|
h(m, {
|
|
277
277
|
class: d(["tw-mt-1.5", e.$style["file-select-button"]]),
|
|
@@ -281,7 +281,7 @@ function B(e, t, i, a, n, l) {
|
|
|
281
281
|
onClick: c(l.openFileDialog, ["stop", "prevent"])
|
|
282
282
|
}, {
|
|
283
283
|
default: T(() => [
|
|
284
|
-
|
|
284
|
+
w(e.$slots, "submitText", {}, () => [
|
|
285
285
|
y(p(n.fileUploadUploadFileText), 1)
|
|
286
286
|
])
|
|
287
287
|
]),
|
|
@@ -290,7 +290,7 @@ function B(e, t, i, a, n, l) {
|
|
|
290
290
|
], 64))
|
|
291
291
|
], 2),
|
|
292
292
|
e.$slots.hint && !i.files.length ? (r(), o("div", X, [
|
|
293
|
-
|
|
293
|
+
w(e.$slots, "hint")
|
|
294
294
|
])) : S("", !0)
|
|
295
295
|
], 34)),
|
|
296
296
|
U(f("input", M(l.inputAttrs, {
|
|
@@ -309,7 +309,7 @@ const V = {
|
|
|
309
309
|
}, le = /* @__PURE__ */ P(k, [["render", B], ["__cssModules", V]]);
|
|
310
310
|
export {
|
|
311
311
|
E as FILE_TYPES,
|
|
312
|
-
|
|
312
|
+
_ as Sizes,
|
|
313
313
|
le as default
|
|
314
314
|
};
|
|
315
315
|
//# sourceMappingURL=FileUpload.js.map
|
package/dist/FileUpload.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.js","sources":["../src/components/FileUpload/FileUpload.vue"],"sourcesContent":["<script>\n import InlineSvg from 'vue-inline-svg';\n\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n export const FILE_TYPES = Object.freeze({\n CSV: {\n ACCEPTS: ['text/csv'],\n EXTENSION: ['csv'],\n MIME_TYPES: ['text/csv', 'application/octet-stream', 'application/vnd.ms-excel'],\n ILLUSTRATION: 'csv',\n },\n PDF: {\n ACCEPTS: ['application/pdf'],\n EXTENSION: ['pdf'],\n MIME_TYPES: ['application/pdf'],\n ILLUSTRATION: 'pdf',\n },\n PNG: {\n ACCEPTS: ['image/png'],\n EXTENSION: ['png'],\n MIME_TYPES: ['image/png'],\n ILLUSTRATION: 'image',\n },\n JPEG: {\n ACCEPTS: ['image/jpeg'],\n EXTENSION: ['jpg', 'jpeg'],\n MIME_TYPES: ['image/jpeg'],\n ILLUSTRATION: 'image',\n },\n DOC: {\n ACCEPTS: ['application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n EXTENSION: ['doc', 'docx'],\n MIME_TYPES: ['application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ILLUSTRATION: 'document',\n },\n XLS: {\n ACCEPTS: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n EXTENSION: ['xls', 'xlsx'],\n MIME_TYPES: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ILLUSTRATION: 'csv',\n },\n });\n\n // TODO: convert to enum (typescript)\n export const Sizes = Object.freeze({\n Dense: 'dense',\n Standard: 'standard',\n });\n\n export default {\n name: 'll-file-upload',\n\n components: {\n 'll-icon': Icon,\n 'll-button': Button,\n InlineSvg,\n },\n\n inject: ['stashOptions'],\n\n inheritAttrs: false,\n\n props: {\n files: {\n type: Array,\n default: () => [],\n },\n\n /**\n * The file types accepted by the input\n */\n fileTypes: {\n type: Array,\n default: () => Object.keys(FILE_TYPES),\n },\n\n /**\n * Shows only an upload button\n */\n buttonOnly: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Disables the upload button\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When using the drag and drop feature, hide the icon\n * and display everything on one line.\n */\n size: {\n type: String,\n default: 'standard',\n validator: (value) => Object.values(Sizes).includes(value),\n },\n },\n\n emits: ['file-select', 'file-delete', 'file-error'],\n\n setup() {\n return {\n Sizes,\n };\n },\n\n data() {\n return {\n isDraggingOver: false,\n removeText: t('ll.fileUpload.remove'),\n fileUploadUploadFileText: t('ll.fileUpload.uploadFile'),\n fileUploadDragDropFileHereText: t('ll.fileUpload.dragDropFileHere'),\n fileUploadOrText: t('ll.fileUpload.or'),\n };\n },\n\n computed: {\n inputAttrs() {\n const attrs = { ...this.$attrs };\n\n delete attrs['data-test'];\n delete attrs.class;\n delete attrs.type;\n delete attrs.accept;\n\n return attrs;\n },\n\n /**\n * @returns {Array} A list of accepted file types\n */\n acceptedMimeTypes() {\n return this.fileTypes.map((fileType) => this.fileMeta[fileType].MIME_TYPES).reduce(this.flattenArray);\n },\n\n /**\n * @returns {Array} A list of accepted file types\n */\n acceptedFileExtensions() {\n return this.fileTypes.map((fileType) => this.fileMeta[fileType].EXTENSION).reduce(this.flattenArray);\n },\n\n fileMeta() {\n return FILE_TYPES;\n },\n\n illustrationPath() {\n return `${this.stashOptions?.staticPath}/illustrations/FileUpload/${\n FILE_TYPES[this.fileTypes[0]].ILLUSTRATION\n }.svg`;\n },\n },\n\n methods: {\n openFileDialog() {\n if (this.$refs.fileUpload) {\n this.$refs.fileUpload.value = '';\n this.$refs.fileUpload.click();\n }\n },\n\n /**\n * Sets file(s) to selected file(s) from dialogue\n * @param {Object} event - file select event that contains file(s)\n * @returns {Array} An array of files\n */\n handleFileInput(event) {\n const files = [...event.target.files];\n\n this.$emit('file-select', { event, files });\n },\n\n handleDragEnter() {\n this.isDraggingOver = true;\n },\n\n handleDragLeave() {\n this.isDraggingOver = false;\n },\n\n /**\n * Sets file to dropped file if it is proper file type\n * @param {Object} event - file select event that contains file\n */\n async handleDropFile(event) {\n if (this.disabled) {\n return;\n }\n\n const files = [...event.dataTransfer.files];\n\n this.isDraggingOver = false;\n\n if (this.acceptedMimeTypes.length) {\n try {\n const mimeTypePromises = await Promise.all(files.map((file) => this.readMimeType(file)));\n const allCorrectMimeTypes = mimeTypePromises.every((mimeType) => this.acceptedMimeTypes.includes(mimeType));\n\n if (!allCorrectMimeTypes) {\n throw new Error('One or more files contains an unacceptable mime type.');\n }\n\n const allCorrectFileExtensions = files.every((file) => {\n const extension = file.name.split('.').pop();\n\n return this.acceptedFileExtensions.includes(extension);\n });\n\n if (!allCorrectFileExtensions) {\n throw new Error('One or more files contains an unacceptable extension.');\n }\n\n this.$emit('file-select', { event, files });\n } catch (error) {\n this.handleFileError(error);\n }\n } else {\n this.$emit('file-select', { event, files });\n }\n },\n\n handleFileError(error) {\n const message = this.t('ll.fileUpload.errors.incorrectFileType', {\n fileTypes: this.acceptedFileExtensions.join(', '),\n });\n\n if (this.$attrs['file-error']) {\n this.$emit('file-error', message);\n } else {\n this.$notify.warning(message);\n }\n\n throw error;\n },\n\n handleFileDelete(file) {\n this.$emit('file-delete', file);\n },\n\n /**\n * Check for the mime type on the uploaded File object\n * Otherwise load the file and attempt to read it\n * @param file The Uploaded File object\n */\n readMimeType(file) {\n return new Promise((resolve, reject) => {\n if (file.type) {\n return resolve(file.type);\n } else if (window.FileReader) {\n const fileReader = new FileReader();\n\n fileReader.onload = () => {\n const mimeType = fileReader.result.match(/[^:]\\w+\\/[\\w-+\\d.]+(?=;|,)/)\n ? fileReader.result.match(/[^:]\\w+\\/[\\w-+\\d.]+(?=;|,)/)[0]\n : '';\n\n resolve(mimeType);\n };\n\n fileReader.readAsDataURL(file);\n } else {\n reject(new Error('Failed to read file.'));\n }\n });\n },\n\n flattenArray(a, b) {\n return a.concat(b);\n },\n },\n };\n</script>\n\n<template>\n <div :class=\"$attrs.class\" :data-test=\"$attrs['data-test']\">\n <div v-if=\"buttonOnly\">\n <ll-button secondary type=\"button\" :disabled=\"disabled || null\" @click.stop.prevent=\"openFileDialog\">\n {{ fileUploadUploadFileText }}\n </ll-button>\n </div>\n <div\n v-else\n class=\"tw-rounded tw-p-6\"\n :class=\"[$style['file-dropbox'], isDraggingOver && $style['is-dragging'], disabled && $style['is-disabled']]\"\n @dragover.prevent=\"handleDragEnter\"\n @drop.prevent=\"handleDropFile\"\n @dragleave.prevent=\"handleDragLeave\"\n >\n <div\n class=\"tw-flex-column align-center align-middle tw-flex tw-text-center\"\n :class=\"[{ 'md:flex-row tw-items-center': size === Sizes.Dense }]\"\n >\n <template v-if=\"!files.length\">\n <InlineSvg v-if=\"size !== Sizes.Dense\" :src=\"illustrationPath\" name=\"file\" width=\"84\" height=\"96\" />\n <span class=\"text-ice-900\">\n {{ fileUploadDragDropFileHereText }}\n </span>\n <span :class=\"size === Sizes.Dense ? 'md:ml-1 md:mr-2 md:my-0 my-1 text-ice-900' : 'tw-mt-1.5 my-1'\">\n {{ fileUploadOrText }}\n </span>\n <ll-button\n class=\"tw-mt-1.5\"\n secondary\n type=\"button\"\n :class=\"$style['file-select-button']\"\n :disabled=\"disabled\"\n @click.stop.prevent=\"openFileDialog\"\n >\n <!-- @slot for custom submit text -->\n <slot name=\"submitText\">{{ fileUploadUploadFileText }}</slot>\n </ll-button>\n </template>\n <template v-else>\n <div v-for=\"file in files\" :key=\"file.name\">\n <ll-icon name=\"file\" />\n <span>{{ file.name }}</span>\n <ll-button\n :class=\"[$style['remove-button'], $style['button']]\"\n @click.stop.prevent=\"handleFileDelete(file)\"\n >\n {{ removeText }}\n </ll-button>\n </div>\n </template>\n </div>\n <div v-if=\"$slots.hint && !files.length\" class=\"text-small text-ice-700 tw-mt-6 tw-text-center\">\n <!-- @slot for displaying helpful text and/or links -->\n <slot name=\"hint\"></slot>\n </div>\n </div>\n <input\n v-show=\"false\"\n v-bind=\"inputAttrs\"\n ref=\"fileUpload\"\n type=\"file\"\n :accept=\"fileTypes.map((fileType) => fileMeta[fileType].ACCEPTS).reduce(flattenArray)\"\n :multiple=\"$attrs['multiple']\"\n @change=\"handleFileInput($event)\"\n />\n </div>\n</template>\n\n<style lang=\"scss\" module>\n .file-dropbox {\n background: var(--color-ice-200);\n background-image: url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='4' ry='4' stroke='%23C5C9D4FF' stroke-width='1' stroke-dasharray='5 %2c 5' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e\");\n background-repeat: no-repeat;\n border: border('thin');\n border-color: transparent;\n }\n\n .is-dragging {\n background-image: none;\n border-color: var(--color-ice-500);\n\n & > * {\n pointer-events: none;\n }\n }\n\n .is-disabled {\n cursor: no-drop;\n }\n\n // Constrain the upload icon for drag/drop to the required size\n .upload-icon {\n height: 98px;\n width: 84px;\n }\n\n .remove-button.button {\n background: transparent;\n border: none;\n color: var(--color-red-500);\n\n &:hover {\n background: transparent;\n border: none;\n }\n }\n</style>\n"],"names":["FILE_TYPES","Sizes","_sfc_main","Icon","Button","InlineSvg","value","t","attrs","fileType","_a","event","files","file","mimeType","extension","error","message","resolve","reject","fileReader","a","b","_hoisted_3","_createElementBlock","_normalizeClass","_ctx","$props","_hoisted_2","_createVNode","_component_ll_button","$options","$data","args","_createElementVNode","$setup","_Fragment","_renderList","_component_ll_icon","_toDisplayString","_withModifiers","$event","_createBlock","_component_InlineSvg","_renderSlot","_openBlock","_hoisted_4","_mergeProps","_cache"],"mappings":";;;;;;;;;;;;;;;;;GAOeA,IAAa,OAAO,OAAO;AAAA,EACtC,KAAK;AAAA,IACH,SAAS,CAAC,UAAU;AAAA,IACpB,WAAW,CAAC,KAAK;AAAA,IACjB,YAAY,CAAC,YAAY,4BAA4B,0BAA0B;AAAA,IAC/E,cAAc;AAAA,EACf;AAAA,EACD,KAAK;AAAA,IACH,SAAS,CAAC,iBAAiB;AAAA,IAC3B,WAAW,CAAC,KAAK;AAAA,IACjB,YAAY,CAAC,iBAAiB;AAAA,IAC9B,cAAc;AAAA,EACf;AAAA,EACD,KAAK;AAAA,IACH,SAAS,CAAC,WAAW;AAAA,IACrB,WAAW,CAAC,KAAK;AAAA,IACjB,YAAY,CAAC,WAAW;AAAA,IACxB,cAAc;AAAA,EACf;AAAA,EACD,MAAM;AAAA,IACJ,SAAS,CAAC,YAAY;AAAA,IACtB,WAAW,CAAC,OAAO,MAAM;AAAA,IACzB,YAAY,CAAC,YAAY;AAAA,IACzB,cAAc;AAAA,EACf;AAAA,EACD,KAAK;AAAA,IACH,SAAS,CAAC,sBAAsB,yEAAyE;AAAA,IACzG,WAAW,CAAC,OAAO,MAAM;AAAA,IACzB,YAAY,CAAC,sBAAsB,yEAAyE;AAAA,IAC5G,cAAc;AAAA,EACf;AAAA,EACD,KAAK;AAAA,IACH,SAAS,CAAC,4BAA4B,mEAAmE;AAAA,IACzG,WAAW,CAAC,OAAO,MAAM;AAAA,IACzB,YAAY,CAAC,4BAA4B,mEAAmE;AAAA,IAC5G,cAAc;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ArB,EAGM,OAHNsB,GAGM;AAAA,QADJF,EAAyBlB,EAAA,QAAA,MAAA;AAAA;;MAG7BQ,EAQE,SARFa,EAQEhB,EANkB,YAAA;AAAA,MAClB,KAAI;AAAA,MACJ,MAAK;AAAA,MACJ,QAAQJ,EAAA,UAAU,KAAKlB,MAAasB,EAAQ,SAACtB,CAAQ,EAAE,OAAO,EAAE,OAAOsB,EAAY,YAAA;AAAA,MACnF,UAAUL,EAAM,OAAA;AAAA,MAChB,UAAMsB,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAP,MAAEV,EAAe,gBAACU,CAAM;AAAA;UANvB,EAAK;AAAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"FileUpload.js","sources":["../src/components/FileUpload/FileUpload.vue"],"sourcesContent":["<script>\n import InlineSvg from 'vue-inline-svg';\n\n import { t } from '../../locale';\n import Button from '../Button/Button.vue';\n import Icon from '../Icon/Icon.vue';\n\n export const FILE_TYPES = Object.freeze({\n CSV: {\n ACCEPTS: ['text/csv'],\n EXTENSION: ['csv'],\n MIME_TYPES: ['text/csv', 'application/octet-stream', 'application/vnd.ms-excel'],\n ILLUSTRATION: 'csv',\n },\n PDF: {\n ACCEPTS: ['application/pdf'],\n EXTENSION: ['pdf'],\n MIME_TYPES: ['application/pdf'],\n ILLUSTRATION: 'pdf',\n },\n PNG: {\n ACCEPTS: ['image/png'],\n EXTENSION: ['png'],\n MIME_TYPES: ['image/png'],\n ILLUSTRATION: 'image',\n },\n JPEG: {\n ACCEPTS: ['image/jpeg'],\n EXTENSION: ['jpg', 'jpeg'],\n MIME_TYPES: ['image/jpeg'],\n ILLUSTRATION: 'image',\n },\n DOC: {\n ACCEPTS: ['application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n EXTENSION: ['doc', 'docx'],\n MIME_TYPES: ['application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ILLUSTRATION: 'document',\n },\n XLS: {\n ACCEPTS: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n EXTENSION: ['xls', 'xlsx'],\n MIME_TYPES: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ILLUSTRATION: 'csv',\n },\n });\n\n // TODO: convert to enum (typescript)\n export const Sizes = Object.freeze({\n Dense: 'dense',\n Standard: 'standard',\n });\n\n export default {\n name: 'll-file-upload',\n\n components: {\n 'll-icon': Icon,\n 'll-button': Button,\n InlineSvg,\n },\n\n inject: ['stashOptions'],\n\n inheritAttrs: false,\n\n props: {\n files: {\n type: Array,\n default: () => [],\n },\n\n /**\n * The file types accepted by the input\n */\n fileTypes: {\n type: Array,\n default: () => Object.keys(FILE_TYPES),\n },\n\n /**\n * Shows only an upload button\n */\n buttonOnly: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Disables the upload button\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n\n /**\n * When using the drag and drop feature, hide the icon\n * and display everything on one line.\n */\n size: {\n type: String,\n default: 'standard',\n validator: (value) => Object.values(Sizes).includes(value),\n },\n },\n\n emits: ['file-select', 'file-delete', 'file-error'],\n\n setup() {\n return {\n Sizes,\n };\n },\n\n data() {\n return {\n isDraggingOver: false,\n removeText: t('ll.fileUpload.remove'),\n fileUploadUploadFileText: t('ll.fileUpload.uploadFile'),\n fileUploadDragDropFileHereText: t('ll.fileUpload.dragDropFileHere'),\n fileUploadOrText: t('ll.fileUpload.or'),\n };\n },\n\n computed: {\n inputAttrs() {\n const attrs = { ...this.$attrs };\n\n delete attrs['data-test'];\n delete attrs.class;\n delete attrs.type;\n delete attrs.accept;\n\n return attrs;\n },\n\n /**\n * @returns {Array} A list of accepted file types\n */\n acceptedMimeTypes() {\n return this.fileTypes.map((fileType) => this.fileMeta[fileType].MIME_TYPES).reduce(this.flattenArray);\n },\n\n /**\n * @returns {Array} A list of accepted file types\n */\n acceptedFileExtensions() {\n return this.fileTypes.map((fileType) => this.fileMeta[fileType].EXTENSION).reduce(this.flattenArray);\n },\n\n fileMeta() {\n return FILE_TYPES;\n },\n\n illustrationPath() {\n return `${this.stashOptions?.staticPath}/illustrations/FileUpload/${\n FILE_TYPES[this.fileTypes[0]].ILLUSTRATION\n }.svg`;\n },\n },\n\n methods: {\n openFileDialog() {\n if (this.$refs.fileUpload) {\n this.$refs.fileUpload.value = '';\n this.$refs.fileUpload.click();\n }\n },\n\n /**\n * Sets file(s) to selected file(s) from dialogue\n * @param {Object} event - file select event that contains file(s)\n * @returns {Array} An array of files\n */\n handleFileInput(event) {\n const files = [...event.target.files];\n\n this.$emit('file-select', { event, files });\n },\n\n handleDragEnter() {\n this.isDraggingOver = true;\n },\n\n handleDragLeave() {\n this.isDraggingOver = false;\n },\n\n /**\n * Sets file to dropped file if it is proper file type\n * @param {Object} event - file select event that contains file\n */\n async handleDropFile(event) {\n if (this.disabled) {\n return;\n }\n\n const files = [...event.dataTransfer.files];\n\n this.isDraggingOver = false;\n\n if (this.acceptedMimeTypes.length) {\n try {\n const mimeTypePromises = await Promise.all(files.map((file) => this.readMimeType(file)));\n const allCorrectMimeTypes = mimeTypePromises.every((mimeType) => this.acceptedMimeTypes.includes(mimeType));\n\n if (!allCorrectMimeTypes) {\n throw new Error('One or more files contains an unacceptable mime type.');\n }\n\n const allCorrectFileExtensions = files.every((file) => {\n const extension = file.name.split('.').pop();\n\n return this.acceptedFileExtensions.includes(extension);\n });\n\n if (!allCorrectFileExtensions) {\n throw new Error('One or more files contains an unacceptable extension.');\n }\n\n this.$emit('file-select', { event, files });\n } catch (error) {\n this.handleFileError(error);\n }\n } else {\n this.$emit('file-select', { event, files });\n }\n },\n\n handleFileError(error) {\n const message = this.t('ll.fileUpload.errors.incorrectFileType', {\n fileTypes: this.acceptedFileExtensions.join(', '),\n });\n\n if (this.$attrs['file-error']) {\n this.$emit('file-error', message);\n } else {\n this.$notify.warning(message);\n }\n\n throw error;\n },\n\n handleFileDelete(file) {\n this.$emit('file-delete', file);\n },\n\n /**\n * Check for the mime type on the uploaded File object\n * Otherwise load the file and attempt to read it\n * @param file The Uploaded File object\n */\n readMimeType(file) {\n return new Promise((resolve, reject) => {\n if (file.type) {\n return resolve(file.type);\n } else if (window.FileReader) {\n const fileReader = new FileReader();\n\n fileReader.onload = () => {\n const mimeType = fileReader.result.match(/[^:]\\w+\\/[\\w-+\\d.]+(?=;|,)/)\n ? fileReader.result.match(/[^:]\\w+\\/[\\w-+\\d.]+(?=;|,)/)[0]\n : '';\n\n resolve(mimeType);\n };\n\n fileReader.readAsDataURL(file);\n } else {\n reject(new Error('Failed to read file.'));\n }\n });\n },\n\n flattenArray(a, b) {\n return a.concat(b);\n },\n },\n };\n</script>\n\n<template>\n <div :class=\"$attrs.class\" :data-test=\"$attrs['data-test']\">\n <div v-if=\"buttonOnly\">\n <ll-button secondary type=\"button\" :disabled=\"disabled || null\" @click.stop.prevent=\"openFileDialog\">\n {{ fileUploadUploadFileText }}\n </ll-button>\n </div>\n <div\n v-else\n class=\"tw-rounded tw-p-6\"\n :class=\"[$style['file-dropbox'], isDraggingOver && $style['is-dragging'], disabled && $style['is-disabled']]\"\n @dragover.prevent=\"handleDragEnter\"\n @drop.prevent=\"handleDropFile\"\n @dragleave.prevent=\"handleDragLeave\"\n >\n <div\n class=\"tw-flex-column align-center align-middle tw-flex tw-text-center\"\n :class=\"[{ 'md:flex-row tw-items-center': size === Sizes.Dense }]\"\n >\n <template v-if=\"!files.length\">\n <InlineSvg v-if=\"size !== Sizes.Dense\" :src=\"illustrationPath\" name=\"file\" width=\"84\" height=\"96\" />\n <span class=\"tw-text-ice-900\">\n {{ fileUploadDragDropFileHereText }}\n </span>\n <span :class=\"size === Sizes.Dense ? 'md:ml-1 md:mr-2 md:my-0 my-1 tw-text-ice-900' : 'tw-mt-1.5 my-1'\">\n {{ fileUploadOrText }}\n </span>\n <ll-button\n class=\"tw-mt-1.5\"\n secondary\n type=\"button\"\n :class=\"$style['file-select-button']\"\n :disabled=\"disabled\"\n @click.stop.prevent=\"openFileDialog\"\n >\n <!-- @slot for custom submit text -->\n <slot name=\"submitText\">{{ fileUploadUploadFileText }}</slot>\n </ll-button>\n </template>\n <template v-else>\n <div v-for=\"file in files\" :key=\"file.name\">\n <ll-icon name=\"file\" />\n <span>{{ file.name }}</span>\n <ll-button\n :class=\"[$style['remove-button'], $style['button']]\"\n @click.stop.prevent=\"handleFileDelete(file)\"\n >\n {{ removeText }}\n </ll-button>\n </div>\n </template>\n </div>\n <div v-if=\"$slots.hint && !files.length\" class=\"text-small tw-mt-6 tw-text-center tw-text-ice-700\">\n <!-- @slot for displaying helpful text and/or links -->\n <slot name=\"hint\"></slot>\n </div>\n </div>\n <input\n v-show=\"false\"\n v-bind=\"inputAttrs\"\n ref=\"fileUpload\"\n type=\"file\"\n :accept=\"fileTypes.map((fileType) => fileMeta[fileType].ACCEPTS).reduce(flattenArray)\"\n :multiple=\"$attrs['multiple']\"\n @change=\"handleFileInput($event)\"\n />\n </div>\n</template>\n\n<style lang=\"scss\" module>\n .file-dropbox {\n background: var(--color-ice-200);\n background-image: url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='4' ry='4' stroke='%23C5C9D4FF' stroke-width='1' stroke-dasharray='5 %2c 5' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e\");\n background-repeat: no-repeat;\n border: border('thin');\n border-color: transparent;\n }\n\n .is-dragging {\n background-image: none;\n border-color: var(--color-ice-500);\n\n & > * {\n pointer-events: none;\n }\n }\n\n .is-disabled {\n cursor: no-drop;\n }\n\n // Constrain the upload icon for drag/drop to the required size\n .upload-icon {\n height: 98px;\n width: 84px;\n }\n\n .remove-button.button {\n background: transparent;\n border: none;\n color: var(--color-red-500);\n\n &:hover {\n background: transparent;\n border: none;\n }\n }\n</style>\n"],"names":["FILE_TYPES","Sizes","_sfc_main","Icon","Button","InlineSvg","value","t","attrs","fileType","_a","event","files","file","mimeType","extension","error","message","resolve","reject","fileReader","a","b","_hoisted_3","_createElementBlock","_normalizeClass","_ctx","$props","_hoisted_2","_createVNode","_component_ll_button","$options","$data","args","_createElementVNode","$setup","_Fragment","_renderList","_component_ll_icon","_toDisplayString","_withModifiers","$event","_createBlock","_component_InlineSvg","_renderSlot","_openBlock","_hoisted_4","_mergeProps","_cache"],"mappings":";;;;;;;;;;;;;;;;;GAOeA,IAAa,OAAO,OAAO;AAAA,EACtC,KAAK;AAAA,IACH,SAAS,CAAC,UAAU;AAAA,IACpB,WAAW,CAAC,KAAK;AAAA,IACjB,YAAY,CAAC,YAAY,4BAA4B,0BAA0B;AAAA,IAC/E,cAAc;AAAA,EACf;AAAA,EACD,KAAK;AAAA,IACH,SAAS,CAAC,iBAAiB;AAAA,IAC3B,WAAW,CAAC,KAAK;AAAA,IACjB,YAAY,CAAC,iBAAiB;AAAA,IAC9B,cAAc;AAAA,EACf;AAAA,EACD,KAAK;AAAA,IACH,SAAS,CAAC,WAAW;AAAA,IACrB,WAAW,CAAC,KAAK;AAAA,IACjB,YAAY,CAAC,WAAW;AAAA,IACxB,cAAc;AAAA,EACf;AAAA,EACD,MAAM;AAAA,IACJ,SAAS,CAAC,YAAY;AAAA,IACtB,WAAW,CAAC,OAAO,MAAM;AAAA,IACzB,YAAY,CAAC,YAAY;AAAA,IACzB,cAAc;AAAA,EACf;AAAA,EACD,KAAK;AAAA,IACH,SAAS,CAAC,sBAAsB,yEAAyE;AAAA,IACzG,WAAW,CAAC,OAAO,MAAM;AAAA,IACzB,YAAY,CAAC,sBAAsB,yEAAyE;AAAA,IAC5G,cAAc;AAAA,EACf;AAAA,EACD,KAAK;AAAA,IACH,SAAS,CAAC,4BAA4B,mEAAmE;AAAA,IACzG,WAAW,CAAC,OAAO,MAAM;AAAA,IACzB,YAAY,CAAC,4BAA4B,mEAAmE;AAAA,IAC5G,cAAc;AAAA,EACf;AACH,CAAC,GAGYC,IAAQ,OAAO,OAAO;AAAA,EACjC,OAAO;AAA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AA;;MAG7BQ,EAQE,SARFa,EAQEhB,EANkB,YAAA;AAAA,MAClB,KAAI;AAAA,MACJ,MAAK;AAAA,MACJ,QAAQJ,EAAA,UAAU,KAAKlB,MAAasB,EAAQ,SAACtB,CAAQ,EAAE,OAAO,EAAE,OAAOsB,EAAY,YAAA;AAAA,MACnF,UAAUL,EAAM,OAAA;AAAA,MAChB,UAAMsB,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAP,MAAEV,EAAe,gBAACU,CAAM;AAAA;UANvB,EAAK;AAAA;;;;;;"}
|
package/dist/FilterSelect.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as S, computed as p, openBlock as r, createBlock as $, withCtx as u, createElementVNode as s, createElementBlock as d, withDirectives as f, vModelCheckbox as v, createVNode as _, withKeys as h, createTextVNode as b, toDisplayString as x, unref as C, createCommentVNode as K, Fragment as A, renderList as B } from "vue";
|
|
2
2
|
import { t as E } from "./locale.js";
|
|
3
|
-
import { _ as N } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { _ as N } from "./Field.vue_vue_type_script_setup_true_lang-4483019d.js";
|
|
4
4
|
import y from "./FilterChip.js";
|
|
5
5
|
import "lodash-es/get";
|
|
6
6
|
import "lodash-es/uniqueId";
|
|
7
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
7
|
+
import "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
8
8
|
import "./Chip.js";
|
|
9
9
|
import "./utils/colorScheme.js";
|
|
10
10
|
import "./Icon.js";
|
package/dist/Filters.js
CHANGED
|
@@ -38,8 +38,8 @@ import "./index-79ce320f.js";
|
|
|
38
38
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
39
39
|
import "lodash-es/isNil";
|
|
40
40
|
import "./utils/i18n.js";
|
|
41
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
42
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
41
|
+
import "./Field.vue_vue_type_script_setup_true_lang-4483019d.js";
|
|
42
|
+
import "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
43
43
|
import "lodash-es/isEmpty";
|
|
44
44
|
import "lodash-es/isEqual";
|
|
45
45
|
import "./useSearch.js";
|
package/dist/InlineEdit.js
CHANGED
|
@@ -5,9 +5,9 @@ import "./constants.js";
|
|
|
5
5
|
import "./locale.js";
|
|
6
6
|
import "lodash-es/get";
|
|
7
7
|
import "lodash-es/isNil";
|
|
8
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
8
|
+
import "./Field.vue_vue_type_script_setup_true_lang-4483019d.js";
|
|
9
9
|
import "lodash-es/uniqueId";
|
|
10
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
10
|
+
import "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
11
11
|
import "./Icon.js";
|
|
12
12
|
import "./index-79ce320f.js";
|
|
13
13
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
package/dist/Input.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent as z, useSlots as P, useCssModule as U, useAttrs as G, ref as f, computed as v, watchEffect as L, onMounted as O, openBlock as m, createBlock as g, mergeProps as V, unref as o, createSlots as W, withCtx as k, createElementVNode as N, withDirectives as q, vModelDynamic as H, createElementBlock as x, normalizeClass as C, renderSlot as y, createCommentVNode as I } from "vue";
|
|
2
2
|
import $ from "lodash-es/isNil";
|
|
3
3
|
import { convertDecimal as j, sanitizeDecimal as J, decimalSeparator as _ } from "./utils/i18n.js";
|
|
4
|
-
import { _ as K } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { _ as K } from "./Field.vue_vue_type_script_setup_true_lang-4483019d.js";
|
|
5
5
|
import Q from "./Icon.js";
|
|
6
6
|
import { _ as R } from "./_plugin-vue_export-helper-dad06003.js";
|
|
7
7
|
import "./constants.js";
|
|
8
8
|
import "./locale.js";
|
|
9
9
|
import "lodash-es/get";
|
|
10
10
|
import "lodash-es/uniqueId";
|
|
11
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
11
|
+
import "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
12
12
|
import "./index-79ce320f.js";
|
|
13
13
|
import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
|
|
14
14
|
const X = { class: "tw-relative" }, Y = ["id", "aria-errormessage", "aria-invalid", "autocomplete", "type"], Z = /* @__PURE__ */ z({
|
package/dist/InputOptions.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as B, useAttrs as S, useSlots as T, useCssModule as $, ref as d, computed as c, watchEffect as k, watch as v, openBlock as E, createBlock as b, mergeProps as m, createSlots as A, withCtx as f, createElementVNode as M, normalizeClass as z, unref as s, createVNode as h, renderSlot as F } from "vue";
|
|
2
|
-
import { _ as N } from "./Field.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as N } from "./Field.vue_vue_type_script_setup_true_lang-4483019d.js";
|
|
3
3
|
import O from "./Input.js";
|
|
4
4
|
import U from "./Select.js";
|
|
5
5
|
import { _ as P } from "./_plugin-vue_export-helper-dad06003.js";
|
|
6
6
|
import "lodash-es/uniqueId";
|
|
7
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
7
|
+
import "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
8
8
|
import "./locale.js";
|
|
9
9
|
import "lodash-es/get";
|
|
10
10
|
import "lodash-es/isNil";
|
package/dist/Label.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as s, computed as n, openBlock as t, createBlock as i, resolveDynamicComponent as d, normalizeClass as c, withCtx as p, renderSlot as f, createElementBlock as o, toDisplayString as u, unref as m, createCommentVNode as
|
|
2
|
-
import { t as
|
|
1
|
+
import { defineComponent as s, computed as n, openBlock as t, createBlock as i, resolveDynamicComponent as d, normalizeClass as c, withCtx as p, renderSlot as f, createElementBlock as o, toDisplayString as u, unref as m, createCommentVNode as w } from "vue";
|
|
2
|
+
import { t as h } from "./locale.js";
|
|
3
3
|
const _ = {
|
|
4
4
|
key: 0,
|
|
5
|
-
class: "
|
|
5
|
+
class: "font-weight-bold tw-text-red-500",
|
|
6
6
|
title: "Required",
|
|
7
7
|
"aria-label": "required"
|
|
8
8
|
}, y = {
|
|
9
9
|
key: 1,
|
|
10
|
-
class: "text-ice-700"
|
|
10
|
+
class: "tw-text-ice-700"
|
|
11
11
|
}, g = /* @__PURE__ */ s({
|
|
12
12
|
__name: "Label",
|
|
13
13
|
props: {
|
|
@@ -25,7 +25,7 @@ const _ = {
|
|
|
25
25
|
}, {
|
|
26
26
|
default: p(() => [
|
|
27
27
|
f(r.$slots, "default"),
|
|
28
|
-
e.isRequired ? (t(), o("span", _, " * ")) : e.showOptional ? (t(), o("span", y, " (" + u(m(
|
|
28
|
+
e.isRequired ? (t(), o("span", _, " * ")) : e.showOptional ? (t(), o("span", y, " (" + u(m(h)("ll.optional")) + ") ", 1)) : w("", !0)
|
|
29
29
|
]),
|
|
30
30
|
_: 3
|
|
31
31
|
}, 8, ["class", "for"]));
|
|
@@ -34,4 +34,4 @@ const _ = {
|
|
|
34
34
|
export {
|
|
35
35
|
g as _
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=Label.vue_vue_type_script_setup_true_lang-
|
|
37
|
+
//# sourceMappingURL=Label.vue_vue_type_script_setup_true_lang-2de35913.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"Label.vue_vue_type_script_setup_true_lang-2de35913.js","sources":["../src/components/Label/Label.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue';\n\n import { t } from '../../locale';\n\n export interface LabelProps {\n for?: string;\n hasError?: boolean;\n isRequired?: boolean;\n showOptional?: boolean;\n /**\n * Indicates whether the wrapper element to be rendered\n * should be a label or a legend.\n */\n legend?: boolean;\n }\n\n const props = withDefaults(defineProps<LabelProps>(), {\n for: undefined,\n hasError: false,\n isRequired: false,\n showOptional: false,\n legend: false,\n });\n\n const wrapperElement = computed(() => {\n return props.legend ? 'legend' : 'label';\n });\n</script>\n\n<template>\n <component\n :is=\"wrapperElement\"\n class=\"stash-label tw-block tw-truncate tw-text-sm tw-font-medium tw-leading-6 tw-text-ice-900\"\n :class=\"{ 'animate-shake': props.hasError }\"\n :for=\"props.for\"\n >\n <!-- @slot the label text -->\n <slot></slot>\n <span v-if=\"props.isRequired\" class=\"font-weight-bold tw-text-red-500\" title=\"Required\" aria-label=\"required\">\n *\n </span>\n <span v-else-if=\"props.showOptional\" class=\"tw-text-ice-700\"> ({{ t('ll.optional') }}) </span>\n </component>\n</template>\n"],"names":["wrapperElement","computed","props"],"mappings":";;;;;;;;;;;;;;;;;;;;iBAyBQA,IAAiBC,EAAS,MACvBC,EAAM,SAAS,WAAW,OAClC;;;;;;;;;;;;;"}
|
package/dist/ListView.js
CHANGED
|
@@ -46,8 +46,8 @@ import "./utils/formatDateTime.js";
|
|
|
46
46
|
import "./utils/normalizeDate.js";
|
|
47
47
|
import "./toTimeZone-e6e9ab75.js";
|
|
48
48
|
import "./InputOptions.js";
|
|
49
|
-
import "./Field.vue_vue_type_script_setup_true_lang-
|
|
50
|
-
import "./Label.vue_vue_type_script_setup_true_lang-
|
|
49
|
+
import "./Field.vue_vue_type_script_setup_true_lang-4483019d.js";
|
|
50
|
+
import "./Label.vue_vue_type_script_setup_true_lang-2de35913.js";
|
|
51
51
|
import "./Select.js";
|
|
52
52
|
import "lodash-es/isEmpty";
|
|
53
53
|
import "lodash-es/isEqual";
|
|
@@ -320,7 +320,7 @@ function Ae(e, l, s, _, i, t) {
|
|
|
320
320
|
}, [
|
|
321
321
|
s.isCollapsible ? (a(), h(g, {
|
|
322
322
|
key: 0,
|
|
323
|
-
class: r(["
|
|
323
|
+
class: r(["tw-mr-1.5 tw-text-ice-900", e.$style["expansion-toggle-button"]]),
|
|
324
324
|
icon: ""
|
|
325
325
|
}, {
|
|
326
326
|
default: m(() => [
|
|
@@ -451,12 +451,12 @@ const Pe = {
|
|
|
451
451
|
function Le(e, l, s, _, i, t) {
|
|
452
452
|
const c = d("ll-icon");
|
|
453
453
|
return a(), o("div", {
|
|
454
|
-
class: r(["tw-cursor-pointer", { "
|
|
454
|
+
class: r(["tw-cursor-pointer", { "tw-bg-blue-100": t.isSorted }]),
|
|
455
455
|
onClick: l[0] || (l[0] = (...g) => t.sort && t.sort(...g))
|
|
456
456
|
}, [
|
|
457
457
|
f(e.$slots, "default"),
|
|
458
458
|
u("div", {
|
|
459
|
-
class: r(["
|
|
459
|
+
class: r(["h-4 w-3 tw-relative tw-text-ice-700", { "is-active-sort": t.isSorted }])
|
|
460
460
|
}, [
|
|
461
461
|
t.showCaretUp ? (a(), h(c, {
|
|
462
462
|
key: 0,
|
|
@@ -1118,7 +1118,7 @@ function Ke(e, l, s, _, i, t) {
|
|
|
1118
1118
|
}, {
|
|
1119
1119
|
default: m(() => [
|
|
1120
1120
|
p(c, {
|
|
1121
|
-
class: r({ "fx-spin text-teal": i.isFiltering }),
|
|
1121
|
+
class: r({ "fx-spin tw-text-teal-500": i.isFiltering }),
|
|
1122
1122
|
name: i.isFiltering ? "working" : "search"
|
|
1123
1123
|
}, null, 8, ["class", "name"])
|
|
1124
1124
|
]),
|
|
@@ -1148,7 +1148,7 @@ function Ke(e, l, s, _, i, t) {
|
|
|
1148
1148
|
i.isFiltering ? (a(), h(c, {
|
|
1149
1149
|
key: 0,
|
|
1150
1150
|
name: "working",
|
|
1151
|
-
class: r([{ "fx-spin": i.isFiltering }, i.isShowingFilters ? "text-teal" : "text-ice-700"])
|
|
1151
|
+
class: r([{ "fx-spin": i.isFiltering }, i.isShowingFilters ? "tw-text-teal-500" : "tw-text-ice-700"])
|
|
1152
1152
|
}, null, 8, ["class"])) : (a(), h(c, {
|
|
1153
1153
|
key: 1,
|
|
1154
1154
|
name: "filter-line"
|
|
@@ -1230,7 +1230,7 @@ function Ke(e, l, s, _, i, t) {
|
|
|
1230
1230
|
S === i.sortTerm ? (a(), h(c, {
|
|
1231
1231
|
key: 0,
|
|
1232
1232
|
name: "check",
|
|
1233
|
-
class: "
|
|
1233
|
+
class: "tw-ml-auto tw-text-blue-500"
|
|
1234
1234
|
})) : n("", !0)
|
|
1235
1235
|
]),
|
|
1236
1236
|
_: 2
|