@mixd-id/web-scaffold 0.2.240706 → 0.2.250801009
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/docs/components/Dashboard.md +56 -0
- package/log.txt +7 -0
- package/package.json +27 -19
- package/src/components/404.vue +61 -0
- package/src/components/AccountIcon.vue +19 -0
- package/src/components/Ahref.vue +1 -1
- package/src/components/Alert.vue +4 -13
- package/src/components/ArrayList.vue +49 -0
- package/src/components/Article.vue +24 -30
- package/src/components/Button.vue +79 -167
- package/src/components/Card.vue +235 -0
- package/src/components/Carousel.vue +61 -60
- package/src/components/Cart.vue +192 -0
- package/src/components/CartIcon.vue +89 -0
- package/src/components/ChartBar.vue +2 -3
- package/src/components/Checkbox.vue +20 -11
- package/src/components/Checkout.vue +373 -0
- package/src/components/CheckoutDelivery.vue +267 -0
- package/src/components/CodeEditor.vue +5 -16
- package/src/components/CollapsiblePanel.vue +70 -0
- package/src/components/ColorPicker.vue +8 -3
- package/src/components/ColorPicker2.vue +41 -19
- package/src/components/ColorPicker3.vue +100 -0
- package/src/components/Confirm.vue +9 -7
- package/src/components/ContextMenu.vue +122 -206
- package/src/components/ContextMenuItem.vue +53 -0
- package/src/components/Dashboard.vue +243 -0
- package/src/components/Dashboard2.vue +118 -0
- package/src/components/DashboardComponentSelector.vue +96 -0
- package/src/components/DashboardConfigs.vue +202 -0
- package/src/components/Datepicker.vue +102 -41
- package/src/components/DayTimeRange.vue +3 -2
- package/src/components/Dropdown.vue +7 -4
- package/src/components/Flex.vue +14 -40
- package/src/components/GHeatMaps.vue +2 -2
- package/src/components/Grid.vue +6 -6
- package/src/components/HTMLEditor.vue +27 -14
- package/src/components/Image.vue +62 -108
- package/src/components/ImagePreview.vue +14 -4
- package/src/components/ImageUploader.vue +114 -0
- package/src/components/ImportModal.vue +3 -3
- package/src/components/Link.vue +62 -6
- package/src/components/List.vue +524 -403
- package/src/components/ListContextMenu.vue +88 -0
- package/src/components/ListItem.vue +5 -3
- package/src/components/ListPage1.vue +14 -15
- package/src/components/ListView.vue +5 -6
- package/src/components/ListViewSettings.vue +2 -2
- package/src/components/LogViewerItem.vue +1 -1
- package/src/components/MarkdownEdit.vue +128 -0
- package/src/components/MarkdownPreview.vue +102 -0
- package/src/components/MenuItem1.vue +36 -0
- package/src/components/Modal.vue +95 -43
- package/src/components/MultiDropdown.vue +124 -0
- package/src/components/MultilineText.vue +1 -4
- package/src/components/OTPField.vue +11 -17
- package/src/components/ObjectTree.vue +1 -1
- package/src/components/PageBuilder.vue +3 -3
- package/src/components/Paragraph.vue +1 -2
- package/src/components/PresetSelectorFilterItem.vue +107 -95
- package/src/components/Radio.vue +1 -1
- package/src/components/SearchModal.vue +153 -0
- package/src/components/Slider.vue +1 -1
- package/src/components/Svg.vue +1 -1
- package/src/components/SvgEditor.vue +173 -0
- package/src/components/Switch.vue +4 -5
- package/src/components/Table.vue +2 -2
- package/src/components/TableView.vue +2 -3
- package/src/components/TableViewHead.vue +2 -2
- package/src/components/Tabs.vue +1 -1
- package/src/components/Testimonial.vue +2 -2
- package/src/components/Text.vue +7 -22
- package/src/components/TextEditor.vue +3 -3
- package/src/components/TextWithTag.vue +61 -30
- package/src/components/Textarea.vue +11 -16
- package/src/components/Textbox.vue +9 -19
- package/src/components/Timepicker.vue +25 -15
- package/src/components/Toast.vue +5 -3
- package/src/components/TreeMenu.vue +122 -0
- package/src/components/TreeView.vue +15 -10
- package/src/components/TreeView2.vue +38 -0
- package/src/components/TreeViewItem.vue +58 -29
- package/src/components/TreeViewItem2.vue +55 -0
- package/src/components/Uploader.vue +45 -0
- package/src/components/Video.vue +119 -0
- package/src/components/VirtualGrid.vue +24 -7
- package/src/components/VirtualTable.vue +363 -128
- package/src/configs/dashboard/data-table.js +9 -0
- package/src/configs/web-page-builder.js +118 -0
- package/src/directives/intersect.js +26 -0
- package/src/hooks/device.js +14 -0
- package/src/index.js +62 -107
- package/src/mixin/component.js +147 -67
- package/src/themes/default/index.js +83 -155
- package/src/utils/dashboard.js +22 -962
- package/src/utils/helpers.cjs +635 -0
- package/src/utils/helpers.js +91 -60
- package/src/utils/helpers.mjs +245 -12
- package/src/utils/importer.js +22 -3
- package/src/utils/list.mjs +1509 -0
- package/src/utils/preset-selector.cjs +1455 -0
- package/src/utils/preset-selector.js +489 -95
- package/src/utils/preset-selector.mjs +59 -20
- package/src/utils/queue.js +63 -0
- package/src/utils/web.mjs +120 -0
- package/src/utils/wss.js +37 -29
- package/src/utils/wss.mjs +24 -19
- package/src/widgets/AhrefSetting.vue +16 -13
- package/src/widgets/ArticleSetting.vue +15 -27
- package/src/widgets/BackgroundColorSetting.vue +153 -0
- package/src/widgets/BorderColorSetting.vue +57 -0
- package/src/widgets/BotEditor/BotEditorActions.vue +3 -2
- package/src/widgets/BotEditor/BotEditorSettings.vue +21 -0
- package/src/widgets/BotEditor.vue +35 -15
- package/src/widgets/ButtonSetting.vue +12 -13
- package/src/widgets/CarouselSetting.vue +33 -45
- package/src/widgets/CartSetting.vue +46 -0
- package/src/widgets/CheckoutSetting.vue +46 -0
- package/src/widgets/CollapsiblePanelSetting.vue +46 -0
- package/src/widgets/ColumnSelector.vue +29 -5
- package/src/widgets/ComponentSetting.vue +1 -1
- package/src/widgets/ComponentSetting2.vue +112 -234
- package/src/widgets/ComponentSetting3.vue +1 -1
- package/src/widgets/ContactForm.vue +3 -3
- package/src/widgets/ContactFormSetting.vue +41 -30
- package/src/widgets/Dashboard/BarChart.vue +47 -11
- package/src/widgets/Dashboard/BarChartSetting.vue +1 -1
- package/src/widgets/Dashboard/DataTable.vue +125 -0
- package/src/widgets/Dashboard/DataTableSetting.vue +243 -0
- package/src/widgets/Dashboard/DatasourceSelector.vue +1 -1
- package/src/widgets/Dashboard/Doughnut.vue +49 -7
- package/src/widgets/Dashboard/DoughnutSetting.vue +2 -2
- package/src/widgets/Dashboard/Metric.vue +78 -19
- package/src/widgets/Dashboard/MetricSetting.vue +81 -28
- package/src/widgets/Dashboard/Pie.vue +55 -6
- package/src/widgets/Dashboard/PieSetting.vue +1 -1
- package/src/widgets/Dashboard/PolarArea.vue +49 -7
- package/src/widgets/Dashboard/PolarAreaSetting.vue +1 -1
- package/src/widgets/Dashboard/SharingModal.vue +4 -5
- package/src/widgets/Dashboard/ViewSelector.vue +2 -2
- package/src/widgets/Dashboard/VirtualTableSetting.vue +121 -184
- package/src/widgets/{Dashboard.vue → Dashboard0.vue} +426 -343
- package/src/widgets/EmbeddedVideoSetting.vue +7 -5
- package/src/widgets/FAQ.vue +16 -3
- package/src/widgets/FAQSetting.vue +53 -47
- package/src/widgets/FeatureList.vue +3 -0
- package/src/widgets/FeatureListSetting.vue +112 -102
- package/src/widgets/FlexSetting.vue +83 -106
- package/src/widgets/GridSetting.vue +71 -196
- package/src/widgets/Header2.vue +34 -71
- package/src/widgets/Header2Setting.vue +95 -179
- package/src/widgets/HeaderSetting.vue +16 -18
- package/src/widgets/IconListSetting.vue +69 -65
- package/src/widgets/ImageSetting.vue +33 -60
- package/src/widgets/LinkSetting.vue +60 -37
- package/src/widgets/LinkSettingModal.vue +173 -0
- package/src/widgets/LogViewer.vue +1 -1
- package/src/widgets/MarginSetting.vue +2 -2
- package/src/widgets/MenuEditor.vue +1 -1
- package/src/widgets/MenuItem1Setting.vue +78 -0
- package/src/widgets/ModalSetting.vue +42 -44
- package/src/widgets/MultiValueSetting.vue +2 -2
- package/src/widgets/MultiValueSetting2.vue +78 -45
- package/src/widgets/OGSettingModal.vue +103 -0
- package/src/widgets/PaddingSetting.vue +2 -2
- package/src/widgets/ParagraphSetting.vue +16 -13
- package/src/widgets/PositionSetting.vue +209 -0
- package/src/widgets/PresetBar.vue +359 -210
- package/src/widgets/PresetBarPivot.vue +31 -19
- package/src/widgets/PresetSelector.vue +29 -17
- package/src/widgets/SearchModalSetting.vue +70 -0
- package/src/widgets/Share.vue +1 -2
- package/src/widgets/ShareSetting.vue +67 -60
- package/src/widgets/StyleSetting.vue +227 -116
- package/src/widgets/TestimonialSetting.vue +97 -88
- package/src/widgets/TextBlockSetting.vue +16 -13
- package/src/widgets/UserActionBuilder/UserActionConsole.vue +30 -10
- package/src/widgets/UserActionBuilder/UserActionOutput.vue +2 -2
- package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +64 -87
- package/src/widgets/UserActionBuilder/UserActionProps.vue +3 -3
- package/src/widgets/UserActionBuilder.vue +4 -16
- package/src/widgets/WebComponentSelector.vue +15 -11
- package/src/widgets/WebLayoutSelector.vue +41 -270
- package/src/widgets/WebPageBuilder.vue +693 -704
- package/src/widgets/WebPageBuilder2.vue +7 -7
- package/src/widgets/WebPageBuilder4/ButtonSetting.vue +0 -8
- package/src/widgets/WebPageBuilder4/CarouselSetting.vue +63 -7
- package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +3 -3
- package/src/widgets/WebPageBuilder4/FlexSetting.vue +1 -10
- package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +2 -2
- package/src/widgets/WebPageBuilder4/PropertySetting.vue +0 -7
- package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +1 -7
- package/src/widgets/WebPageBuilder4.vue +289 -575
- package/src/widgets/WebPageSelector.vue +1 -1
- package/src/widgets/YoutubeVideoSetting.vue +16 -13
- package/tailwind.config.js +3 -35
- package/docs/schema/user-action.json +0 -266
- package/src/App.vue +0 -25
- package/src/components/SearchButton.vue +0 -57
- package/src/entry-client.js +0 -27
- package/src/entry-server.js +0 -73
- package/src/events/event.js +0 -2
- package/src/main.js +0 -29
- package/src/mixin/website.js +0 -121
- package/src/router.js +0 -57
- package/src/widgets/MobileMenu.vue +0 -182
- package/src/widgets/WebPageBuilder4/ActionSetting.vue +0 -158
- package/src/widgets/WebPageBuilder4/ColorSetting.vue +0 -63
- package/src/widgets/WebPageBuilder4/DataSetting.vue +0 -92
- package/src/widgets/WebPageBuilder4/FontSizeSetting.vue +0 -76
- package/src/widgets/WebPageBuilder4/LinkSetting.vue +0 -68
- package/src/widgets/WebPageBuilder4/MobileMenuSetting.vue +0 -106
- package/src/widgets/WebPageBuilder4/Setting.vue +0 -73
- package/src/widgets/WebPageBuilder4/StyleSetting.vue +0 -77
- package/src/widgets/WebPageBuilder4/SvgSetting.vue +0 -207
- package/src/widgets/WebPageBuilder4/TextTransformSetting.vue +0 -70
- package/src/widgets/WebPageBuilder4/WebPageDataEdit.vue +0 -121
- package/test.json +0 -22
- /package/src/widgets/{Header1.vue → Header0.vue} +0 -0
- /package/src/widgets/{Header1Setting.vue → Header0Setting.vue} +0 -0
|
@@ -1,24 +1,51 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
|
-
<div v-if="mode === ''" :class="compClass">
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
<div v-if="mode === ''" :class="compClass" class="divide-x divide-border-50">
|
|
4
|
+
<div class="w-[80px] flex flex-row items-center relative">
|
|
5
|
+
<select v-model="DD" class="text-left w-full flex-1 px-3">
|
|
6
|
+
<option disabled selected>Tanggal</option>
|
|
7
|
+
<option v-for="d in 31" :value="d.toString().padStart(2, '0')">{{ d }}</option>
|
|
8
|
+
</select>
|
|
9
|
+
|
|
10
|
+
<div class="absolute top-0 bottom-0 right-0 p-2 flex justify-center items-center pointer-events-none">
|
|
11
|
+
<svg class="fill-text-300" width="16" height="16" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
12
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.96967 8.71967C5.26256 8.42678 5.73744 8.42678 6.03033 8.71967L11.8232 14.5126C11.9209 14.6102 12.0791 14.6102 12.1768 14.5126L17.9697 8.71967C18.2626 8.42677 18.7374 8.42677 19.0303 8.71967C19.3232 9.01256 19.3232 9.48743 19.0303 9.78033L13.2374 15.5732C12.554 16.2566 11.446 16.2566 10.7626 15.5732L4.96967 9.78033C4.67678 9.48744 4.67678 9.01256 4.96967 8.71967Z"/>
|
|
13
|
+
</svg>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div class="w-[120px] flex flex-row items-center relative">
|
|
18
|
+
<select v-model="MM" class="text-left w-full flex-1 px-3">
|
|
19
|
+
<option disabled selected>Bulan</option>
|
|
20
|
+
<option v-for="mmm in months" :value="mmm[0]">{{ mmm[1] }}</option>
|
|
21
|
+
</select>
|
|
22
|
+
|
|
23
|
+
<div class="absolute top-0 bottom-0 right-0 p-2 flex justify-center items-center pointer-events-none">
|
|
24
|
+
<svg class="fill-text-300" width="16" height="16" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
25
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.96967 8.71967C5.26256 8.42678 5.73744 8.42678 6.03033 8.71967L11.8232 14.5126C11.9209 14.6102 12.0791 14.6102 12.1768 14.5126L17.9697 8.71967C18.2626 8.42677 18.7374 8.42677 19.0303 8.71967C19.3232 9.01256 19.3232 9.48743 19.0303 9.78033L13.2374 15.5732C12.554 16.2566 11.446 16.2566 10.7626 15.5732L4.96967 9.78033C4.67678 9.48744 4.67678 9.01256 4.96967 8.71967Z"/>
|
|
26
|
+
</svg>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="w-[100px] flex flex-row items-center relative">
|
|
31
|
+
<select v-model="YYYY" class="text-left w-full flex-1 px-3">
|
|
32
|
+
<option disabled selected>Tahun</option>
|
|
33
|
+
<option v-for="yyyy in years" :value="yyyy">{{ yyyy }}</option>
|
|
34
|
+
</select>
|
|
35
|
+
|
|
36
|
+
<div class="absolute top-0 bottom-0 right-0 p-2 flex justify-center items-center pointer-events-none">
|
|
37
|
+
<svg class="fill-text-300" width="16" height="16" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
38
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.96967 8.71967C5.26256 8.42678 5.73744 8.42678 6.03033 8.71967L11.8232 14.5126C11.9209 14.6102 12.0791 14.6102 12.1768 14.5126L17.9697 8.71967C18.2626 8.42677 18.7374 8.42677 19.0303 8.71967C19.3232 9.01256 19.3232 9.48743 19.0303 9.78033L13.2374 15.5732C12.554 16.2566 11.446 16.2566 10.7626 15.5732L4.96967 9.78033C4.67678 9.48744 4.67678 9.01256 4.96967 8.71967Z"/>
|
|
39
|
+
</svg>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
16
43
|
</div>
|
|
17
44
|
|
|
18
45
|
<div v-else :class="compClass">
|
|
19
46
|
|
|
20
47
|
<div v-if="mode === 'popup'" ref="popup"
|
|
21
|
-
@click="!readonly ? contextMenu = { caller:$refs.popup, value:this.
|
|
48
|
+
@click="!readonly ? contextMenu = { caller:$refs.popup, value:this.mModelValue } : null"
|
|
22
49
|
class="flex-1">
|
|
23
50
|
<input class="flex-1" type="text" readonly :value="DMMMYYYY"/>
|
|
24
51
|
<div :class="$style.arrow" v-if="!readonly">
|
|
@@ -51,8 +78,11 @@
|
|
|
51
78
|
</div>
|
|
52
79
|
</div>
|
|
53
80
|
|
|
54
|
-
<ContextMenu v-if="mode === 'popup'"
|
|
55
|
-
|
|
81
|
+
<ContextMenu v-if="mode === 'popup'"
|
|
82
|
+
class="mt-3"
|
|
83
|
+
:state="!!(contextMenu.caller)"
|
|
84
|
+
:caller="contextMenu.caller ?? null"
|
|
85
|
+
@dismiss="contextMenu = {}">
|
|
56
86
|
<div class="p-4">
|
|
57
87
|
<div class="flex items-center">
|
|
58
88
|
<h4 class="flex-1">{{ contextMenuTitle }}</h4>
|
|
@@ -70,10 +100,14 @@
|
|
|
70
100
|
<div class="grid grid-cols-7 gap-2 mt-2">
|
|
71
101
|
<div v-for="i in 7">{{ getDayOfWeekLabel(i) }}</div>
|
|
72
102
|
<button type="button" :class="buttonStyle(d.value)"
|
|
103
|
+
:disabled="(allowedDates && !allowedDates.includes(d.value)) || (onlyTodayAndFuture && isValidTodayAndFuture(d.value)) || (pastOnly && isPast(d.value))"
|
|
73
104
|
v-for="d in contextMenuDates" @click="setValue(d.value)">
|
|
74
105
|
{{ d.date }}
|
|
75
106
|
</button>
|
|
76
107
|
</div>
|
|
108
|
+
<div class="mt-6">
|
|
109
|
+
<button type="button" class="text-primary" @click="this.$emit('update:modelValue', 'today')">Today</button>
|
|
110
|
+
</div>
|
|
77
111
|
</div>
|
|
78
112
|
</ContextMenu>
|
|
79
113
|
|
|
@@ -96,15 +130,13 @@ for(let i = -100 ; i < 50 ; i++){
|
|
|
96
130
|
YEARS.push(currentYear + i)
|
|
97
131
|
}
|
|
98
132
|
|
|
99
|
-
const currentDate = dayjs().format('YYYY-MM-DD')
|
|
100
|
-
|
|
101
133
|
export default{
|
|
102
134
|
|
|
103
135
|
setup(props, { emit }){
|
|
104
136
|
|
|
105
|
-
const DD = ref(dayjs(props.
|
|
106
|
-
const MM = ref(dayjs(props.
|
|
107
|
-
const YYYY = ref(dayjs(props.
|
|
137
|
+
const DD = ref(dayjs(props.mModelValue ?? props.defaultValue).format('DD'))
|
|
138
|
+
const MM = ref(dayjs(props.mModelValue ?? props.defaultValue).format('MM'))
|
|
139
|
+
const YYYY = ref(dayjs(props.mModelValue ?? props.defaultValue).format('YYYY'))
|
|
108
140
|
|
|
109
141
|
watch([ YYYY, MM, DD ], (to) => {
|
|
110
142
|
emit('update:modelValue', to.join('-'))
|
|
@@ -140,18 +172,33 @@ export default{
|
|
|
140
172
|
|
|
141
173
|
readonly: undefined,
|
|
142
174
|
|
|
175
|
+
allowedDates: Array,
|
|
176
|
+
|
|
177
|
+
onlyTodayAndFuture: Boolean,
|
|
178
|
+
pastOnly: Boolean,
|
|
179
|
+
|
|
143
180
|
},
|
|
144
181
|
|
|
145
182
|
computed:{
|
|
146
183
|
|
|
184
|
+
mModelValue(){
|
|
185
|
+
if(this.modelValue === 'today')
|
|
186
|
+
return dayjs().format('YYYY-MM-DD')
|
|
187
|
+
return this.modelValue
|
|
188
|
+
},
|
|
189
|
+
|
|
147
190
|
DMMMYYYY(){
|
|
148
|
-
return this.
|
|
191
|
+
return this.mModelValue ? dayjs(this.mModelValue).format('D MMM YYYY') : ''
|
|
149
192
|
},
|
|
150
193
|
|
|
151
194
|
YYYYMMM(){
|
|
152
195
|
return dayjs(this.contextMenu.value).format('YYYY-MM')
|
|
153
196
|
},
|
|
154
197
|
|
|
198
|
+
today(){
|
|
199
|
+
return dayjs().format('YYYY-MM-DD')
|
|
200
|
+
},
|
|
201
|
+
|
|
155
202
|
compClass(){
|
|
156
203
|
return [
|
|
157
204
|
this.$style.datepicker,
|
|
@@ -181,17 +228,22 @@ export default{
|
|
|
181
228
|
for(let i = 1 ; i <= 42 ; i++){
|
|
182
229
|
if(startDayOfMonth > 0){
|
|
183
230
|
startDayOfMonth--
|
|
231
|
+
const value = dayjsInput.subtract(1, 'month')
|
|
232
|
+
.format(`YYYY-MM-${(endDateOfLastMonth - startDayOfMonth).toString().padStart(2, '0')}`)
|
|
233
|
+
|
|
184
234
|
dates.push({
|
|
185
235
|
date: endDateOfLastMonth - startDayOfMonth,
|
|
186
|
-
value
|
|
187
|
-
|
|
236
|
+
value,
|
|
237
|
+
type: -1
|
|
188
238
|
})
|
|
189
239
|
}
|
|
190
240
|
else if(currentDate > endDateOfMonth){
|
|
191
|
-
|
|
241
|
+
const value = dayjsInput.add(1, 'month').format(`YYYY-MM-${nextDate.toString().padStart(2, '0')}`)
|
|
242
|
+
|
|
243
|
+
dates.push({
|
|
192
244
|
date: nextDate,
|
|
193
|
-
value
|
|
194
|
-
|
|
245
|
+
value,
|
|
246
|
+
type: 1
|
|
195
247
|
})
|
|
196
248
|
nextDate++
|
|
197
249
|
}
|
|
@@ -227,7 +279,7 @@ export default{
|
|
|
227
279
|
buttonStyle(val){
|
|
228
280
|
return [
|
|
229
281
|
this.$style.button,
|
|
230
|
-
this.
|
|
282
|
+
this.mModelValue === val ? this.$style.selected : '',
|
|
231
283
|
dayjs(val).format('YYYY-MM') !== this.YYYYMMM ? this.$style.otherMonth : ''
|
|
232
284
|
]
|
|
233
285
|
.join(' ')
|
|
@@ -247,6 +299,14 @@ export default{
|
|
|
247
299
|
|
|
248
300
|
},
|
|
249
301
|
|
|
302
|
+
isValidTodayAndFuture(val){
|
|
303
|
+
return val.localeCompare(this.today) < 0
|
|
304
|
+
},
|
|
305
|
+
|
|
306
|
+
isPast(val){
|
|
307
|
+
return val.localeCompare(this.today) > 0
|
|
308
|
+
},
|
|
309
|
+
|
|
250
310
|
setValue(d){
|
|
251
311
|
this.$emit('update:modelValue', d)
|
|
252
312
|
this.$emit('change', d)
|
|
@@ -264,16 +324,15 @@ export default{
|
|
|
264
324
|
<style module>
|
|
265
325
|
|
|
266
326
|
.datepicker {
|
|
267
|
-
@apply
|
|
268
|
-
|
|
269
|
-
@apply border-[1px] border-text-200 bg-base-500 rounded-lg;
|
|
327
|
+
@apply flex overflow-hidden cursor-pointer relative;
|
|
328
|
+
@apply border-[1px] border-border-200 bg-base-400 rounded-lg;
|
|
270
329
|
@apply cursor-pointer;
|
|
271
330
|
}
|
|
272
331
|
.datepicker:not(.readonly){
|
|
273
|
-
@apply hover:border-
|
|
332
|
+
@apply hover:border-border-300
|
|
274
333
|
}
|
|
275
334
|
.datepicker select{
|
|
276
|
-
@apply appearance-none p-2 bg-transparent text-center
|
|
335
|
+
@apply appearance-none p-2 bg-transparent text-center outline-none;
|
|
277
336
|
}
|
|
278
337
|
.datepicker input{
|
|
279
338
|
@apply appearance-none p-2 bg-transparent w-full outline-none;
|
|
@@ -290,14 +349,20 @@ export default{
|
|
|
290
349
|
.button{
|
|
291
350
|
@apply rounded-full aspect-square;
|
|
292
351
|
}
|
|
293
|
-
.button:
|
|
352
|
+
.button:not(:disabled){
|
|
353
|
+
@apply cursor-default;
|
|
354
|
+
}
|
|
355
|
+
.button:disabled{
|
|
356
|
+
@apply text-text-300;
|
|
357
|
+
}
|
|
358
|
+
.button:not(:disabled):hover{
|
|
294
359
|
@apply bg-primary-200;
|
|
295
360
|
}
|
|
296
361
|
.button.selected{
|
|
297
362
|
@apply bg-primary text-white;
|
|
298
363
|
}
|
|
299
|
-
.button.otherMonth{
|
|
300
|
-
@apply text-text-
|
|
364
|
+
.button:not(:disabled).otherMonth{
|
|
365
|
+
@apply text-text-400;
|
|
301
366
|
}
|
|
302
367
|
|
|
303
368
|
.arrow{
|
|
@@ -314,11 +379,7 @@ export default{
|
|
|
314
379
|
}
|
|
315
380
|
|
|
316
381
|
.mode-{
|
|
317
|
-
@apply flex flex-row
|
|
318
|
-
}
|
|
319
|
-
.mode- select{
|
|
320
|
-
@apply rounded-lg;
|
|
321
|
-
@apply min-h-[var(--h-cp)];
|
|
382
|
+
@apply inline-flex flex-row;
|
|
322
383
|
}
|
|
323
384
|
.mode- select:first-child{
|
|
324
385
|
@apply w-12;
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
<option value="thu">Thu</option>
|
|
15
15
|
<option value="fri">Fri</option>
|
|
16
16
|
<option value="sat">Sat</option>
|
|
17
|
+
<option value="-">Holiday</option>
|
|
17
18
|
</select>
|
|
18
19
|
</div>
|
|
19
|
-
<div class="flex-1 flex flex-col gap-1 pl-2 border-l-[1px] border-
|
|
20
|
+
<div class="flex-1 flex flex-col gap-1 pl-2 border-l-[1px] border-border-100 divide-y divide-text-100">
|
|
20
21
|
<div v-for="(range, i) in val.value" class="flex flex-row">
|
|
21
22
|
<div class="flex-1 flex flex-row">
|
|
22
23
|
<input type="time" v-model="val.value[i][0]" @blur="updateModelValue()">
|
|
@@ -110,7 +111,7 @@ export default{
|
|
|
110
111
|
<style module>
|
|
111
112
|
|
|
112
113
|
.comp{
|
|
113
|
-
@apply border-[1px] border-
|
|
114
|
+
@apply border-[1px] border-border-200 bg-base-500 rounded-lg;
|
|
114
115
|
@apply inline-flex flex-col divide-y divide-text-100;
|
|
115
116
|
}
|
|
116
117
|
|
|
@@ -161,10 +161,10 @@ export default {
|
|
|
161
161
|
|
|
162
162
|
.dropdown{
|
|
163
163
|
@apply flex items-center rounded-lg overflow-hidden cursor-pointer relative;
|
|
164
|
-
@apply border-[1px] border-
|
|
164
|
+
@apply border-[1px] border-border-200 bg-base-400;
|
|
165
165
|
}
|
|
166
166
|
.dropdown:not(.readonly){
|
|
167
|
-
@apply hover:border-
|
|
167
|
+
@apply hover:border-border-300;
|
|
168
168
|
}
|
|
169
169
|
.dropdown.readonly{
|
|
170
170
|
@apply bg-text-50;
|
|
@@ -176,9 +176,12 @@ export default {
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
.dropdown option{
|
|
179
|
-
@apply bg-base-
|
|
179
|
+
@apply bg-base-300 text-text;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
.dropdown select[disabled]{
|
|
183
|
+
@apply cursor-not-allowed;
|
|
184
|
+
}
|
|
182
185
|
.dropdown option[disabled]{
|
|
183
186
|
@apply text-text-300;
|
|
184
187
|
}
|
|
@@ -190,7 +193,7 @@ export default {
|
|
|
190
193
|
}
|
|
191
194
|
|
|
192
195
|
.arrow svg{
|
|
193
|
-
@apply block fill-text-
|
|
196
|
+
@apply block fill-text-300;
|
|
194
197
|
}
|
|
195
198
|
.dropdown:hover svg{
|
|
196
199
|
@apply fill-text-300;
|
package/src/components/Flex.vue
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.Flex" :style="computedStyle">
|
|
3
3
|
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
<slot name="default">
|
|
5
|
+
<component v-for="item in items"
|
|
6
|
+
:is="item.type"
|
|
7
|
+
:key="item.key"
|
|
8
|
+
:="item" />
|
|
9
|
+
</slot>
|
|
9
10
|
|
|
10
11
|
</div>
|
|
11
12
|
</template>
|
|
@@ -16,48 +17,21 @@ import {componentMixin} from "../mixin/component";
|
|
|
16
17
|
|
|
17
18
|
export default{
|
|
18
19
|
|
|
19
|
-
computed: {
|
|
20
|
-
|
|
21
|
-
cItems(){
|
|
22
|
-
|
|
23
|
-
if(!this.dataKey)
|
|
24
|
-
return this.items
|
|
25
|
-
|
|
26
|
-
const page = this.getPage()
|
|
27
|
-
const obj = page.data?.find(_ => _.key === this.dataKey)
|
|
28
|
-
|
|
29
|
-
if(this.editMode !== 'design'){
|
|
30
|
-
return obj ?
|
|
31
|
-
obj.value.map(_ => ({
|
|
32
|
-
...this.items[0],
|
|
33
|
-
data: _
|
|
34
|
-
})) :
|
|
35
|
-
[]
|
|
36
|
-
}
|
|
37
|
-
else{
|
|
38
|
-
return this.items.length > 0 ? [
|
|
39
|
-
this.items[0]
|
|
40
|
-
] :
|
|
41
|
-
[]
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
inject: [ 'getPage' ],
|
|
48
|
-
|
|
49
20
|
mixins: [ componentMixin ],
|
|
50
21
|
|
|
51
22
|
props:{
|
|
52
|
-
|
|
53
23
|
items: Array,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
24
|
+
flexColumns: Array,
|
|
25
|
+
columnType: Array,
|
|
57
26
|
data: Object
|
|
58
|
-
|
|
59
27
|
},
|
|
60
28
|
|
|
29
|
+
provide(){
|
|
30
|
+
return {
|
|
31
|
+
parentData: this.data
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
61
35
|
}
|
|
62
36
|
|
|
63
37
|
</script>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
<div class="flex flex-row">
|
|
16
16
|
|
|
17
|
-
<div class="flex-1 flex items-center justify-center divide-x divide-
|
|
17
|
+
<div class="flex-1 flex items-center justify-center divide-x divide-border-50 border-l-[1px] border-r-[1px] border-border-50">
|
|
18
18
|
<button type="button" class="p-1 px-3 hover:bg-primary text-text-400" @click="zoomOut">
|
|
19
19
|
<svg width="16" height="16" class="fill-text-500 hover:fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M400 288h-352c-17.69 0-32-14.32-32-32.01s14.31-31.99 32-31.99h352c17.69 0 32 14.3 32 31.99S417.7 288 400 288z"/></svg>
|
|
20
20
|
</button>
|
|
@@ -311,7 +311,7 @@ export default{
|
|
|
311
311
|
<style module>
|
|
312
312
|
|
|
313
313
|
.comp{
|
|
314
|
-
@apply flex flex-col h-[40vh] border-[1px] border-
|
|
314
|
+
@apply flex flex-col h-[40vh] border-[1px] border-border-50 bg-base-500 rounded-xl overflow-hidden;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
</style>
|
package/src/components/Grid.vue
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp" :style="computedStyle">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
<slot>
|
|
4
|
+
<component v-for="item in items"
|
|
5
|
+
:is="item.type"
|
|
6
|
+
:key="item.key"
|
|
7
|
+
:="item" />
|
|
8
|
+
</slot>
|
|
9
9
|
</div>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
3
|
|
|
4
|
-
<div class="overflow-x-auto bg-
|
|
4
|
+
<div class="overflow-x-auto bg-base-400" :class="containerClass" v-if="!readonly">
|
|
5
5
|
<div class="flex flex-row">
|
|
6
6
|
<button class="p-3" type="button" @click="format('bold')">
|
|
7
7
|
<svg width="14" height="14" class="fill-text-400 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M0 64C0 46.3 14.3 32 32 32H80 96 224c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128H96 80 32c-17.7 0-32-14.3-32-32s14.3-32 32-32H48V256 96H32C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64H112V224H224zM112 288V416H256c35.3 0 64-28.7 64-64s-28.7-64-64-64H224 112z"/></svg>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<button class="p-3" type="button" ref="listBtn" @click="$refs.listContext.open($refs.listBtn)">
|
|
22
22
|
<svg width="14" height="14" class="fill-text-400 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M64 144c26.5 0 48-21.5 48-48s-21.5-48-48-48S16 69.5 16 96s21.5 48 48 48zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zM64 464c26.5 0 48-21.5 48-48s-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48zm48-208c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48z"/></svg>
|
|
23
23
|
</button>
|
|
24
|
-
<button class="p-3" type="button" @click="createImage">
|
|
24
|
+
<button v-if="canUpload" class="p-3" type="button" @click="createImage">
|
|
25
25
|
<svg width="14" height="14" class="fill-text-400 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M152 120c-26.51 0-48 21.49-48 48s21.49 48 48 48s48-21.49 48-48S178.5 120 152 120zM447.1 32h-384C28.65 32-.0091 60.65-.0091 96v320c0 35.35 28.65 64 63.1 64h384c35.35 0 64-28.65 64-64V96C511.1 60.65 483.3 32 447.1 32zM463.1 409.3l-136.8-185.9C323.8 218.8 318.1 216 312 216c-6.113 0-11.82 2.768-15.21 7.379l-106.6 144.1l-37.09-46.1c-3.441-4.279-8.934-6.809-14.77-6.809c-5.842 0-11.33 2.529-14.78 6.809l-75.52 93.81c0-.0293 0 .0293 0 0L47.99 96c0-8.822 7.178-16 16-16h384c8.822 0 16 7.178 16 16V409.3z"/></svg>
|
|
26
26
|
</button>
|
|
27
27
|
<button class="p-3" type="button" @click="createLink">
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
<button class="p-3" type="button" @click="removeFormat">
|
|
31
31
|
<svg width="14" height="14" class="fill-text-400 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/></svg>
|
|
32
32
|
</button>
|
|
33
|
-
<button @click="createTable">Table</button>
|
|
33
|
+
<button @click="createTable" class="text-text-400">Table</button>
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
36
36
|
|
|
37
|
-
<article ref="article" contenteditable="
|
|
38
|
-
@input="onInput" @click="onClick"
|
|
37
|
+
<article ref="article" :contenteditable="!readonly" v-html="html" @paste="onPaste" spellcheck="false"
|
|
38
|
+
@input="onInput" @click="onClick" :class="itemClass"
|
|
39
39
|
@blur="onBlur">
|
|
40
40
|
</article>
|
|
41
41
|
|
|
@@ -137,10 +137,10 @@
|
|
|
137
137
|
</template>
|
|
138
138
|
<div class="flex-1 flex flex-col gap-5 p-5">
|
|
139
139
|
<div>
|
|
140
|
-
<Image class="min-h-[100px] bg-
|
|
140
|
+
<Image class="min-h-[100px] bg-text-50 cursor-pointer rounded-xl" ref="image" :src="newImage.src" editable="true"
|
|
141
141
|
@click="$refs.image.edit()" @change="onImageChanged">
|
|
142
142
|
<template #empty="{ instance }">
|
|
143
|
-
<div class="absolute right-0 top-0 bottom-0 left-0 flex items-center justify-center">
|
|
143
|
+
<div class="absolute text-primary underline right-0 top-0 bottom-0 left-0 flex items-center justify-center">
|
|
144
144
|
Click to Add Image...
|
|
145
145
|
</div>
|
|
146
146
|
</template>
|
|
@@ -258,11 +258,19 @@ export default{
|
|
|
258
258
|
|
|
259
259
|
props:{
|
|
260
260
|
modelValue: String,
|
|
261
|
-
uploadImage: String
|
|
261
|
+
uploadImage: String,
|
|
262
|
+
uploadImageFn: String,
|
|
263
|
+
containerClass: String,
|
|
264
|
+
itemClass: String,
|
|
265
|
+
readonly: Boolean
|
|
262
266
|
},
|
|
263
267
|
|
|
264
268
|
computed: {
|
|
265
269
|
|
|
270
|
+
canUpload(){
|
|
271
|
+
return `${this.uploadImage ?? ''}`.length > 0 || typeof this.uploadImageFn === 'function'
|
|
272
|
+
},
|
|
273
|
+
|
|
266
274
|
linkCanSave(){
|
|
267
275
|
return this.newLink.href && this.newLink.text
|
|
268
276
|
},
|
|
@@ -308,8 +316,8 @@ export default{
|
|
|
308
316
|
}
|
|
309
317
|
else{
|
|
310
318
|
this.newImage = {
|
|
311
|
-
width: "",
|
|
312
|
-
height: "",
|
|
319
|
+
width: "120px",
|
|
320
|
+
height: "120px",
|
|
313
321
|
element: null
|
|
314
322
|
}
|
|
315
323
|
}
|
|
@@ -374,6 +382,7 @@ export default{
|
|
|
374
382
|
</tr>
|
|
375
383
|
</table>`);
|
|
376
384
|
|
|
385
|
+
this.$refs.tableModal.close()
|
|
377
386
|
},
|
|
378
387
|
|
|
379
388
|
removeFormat(){
|
|
@@ -545,11 +554,15 @@ export default{
|
|
|
545
554
|
<style module>
|
|
546
555
|
|
|
547
556
|
.comp{
|
|
548
|
-
@apply flex-1 flex flex-col border-[1px] border-
|
|
557
|
+
@apply flex-1 flex flex-col border-[1px] border-border-200 rounded-lg overflow-hidden;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.comp article:before{
|
|
561
|
+
content: " "
|
|
549
562
|
}
|
|
550
563
|
|
|
551
564
|
.comp article {
|
|
552
|
-
@apply
|
|
565
|
+
@apply w-full outline-none p-3 leading-6 bg-base-400;
|
|
553
566
|
@apply flex-1 overflow-auto;
|
|
554
567
|
}
|
|
555
568
|
|
|
@@ -566,10 +579,10 @@ export default{
|
|
|
566
579
|
}
|
|
567
580
|
|
|
568
581
|
.comp table{
|
|
569
|
-
@apply border-[1px] border-
|
|
582
|
+
@apply border-[1px] border-border-200 border-collapse;
|
|
570
583
|
}
|
|
571
584
|
.comp table th, .comp table td{
|
|
572
|
-
@apply border-[1px] border-
|
|
585
|
+
@apply border-[1px] border-border-200 p-3 text-left;
|
|
573
586
|
}
|
|
574
587
|
|
|
575
588
|
</style>
|