lib-pajakio-v2 1.0.17 → 1.0.19
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/lib-pajakio-v2.common.js +1141 -67
- package/dist/lib-pajakio-v2.common.js.map +1 -1
- package/dist/lib-pajakio-v2.css +1 -1
- package/dist/lib-pajakio-v2.umd.js +1141 -67
- package/dist/lib-pajakio-v2.umd.js.map +1 -1
- package/dist/lib-pajakio-v2.umd.min.js +1 -1
- package/dist/lib-pajakio-v2.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ComponentsLayout/NavigationMenu.vue +2 -1
- package/src/components/DashboardHeader/index.vue +257 -8
- package/src/components/Form/FormWysiwyg.vue +1172 -0
- package/src/components/index.js +2 -0
- package/src/router/index.js +6 -0
- package/src/views/Header.vue +60 -1
- package/src/views/Wysiwyg.vue +166 -0
|
@@ -275,17 +275,6 @@ module.exports = function (argument) {
|
|
|
275
275
|
};
|
|
276
276
|
|
|
277
277
|
|
|
278
|
-
/***/ }),
|
|
279
|
-
|
|
280
|
-
/***/ "0f32":
|
|
281
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
282
|
-
|
|
283
|
-
"use strict";
|
|
284
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_faab9602_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7dd7");
|
|
285
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_faab9602_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_faab9602_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
|
|
286
|
-
/* unused harmony reexport * */
|
|
287
|
-
|
|
288
|
-
|
|
289
278
|
/***/ }),
|
|
290
279
|
|
|
291
280
|
/***/ "1212":
|
|
@@ -1380,13 +1369,6 @@ module.exports = function (argument) {
|
|
|
1380
1369
|
/* unused harmony reexport * */
|
|
1381
1370
|
|
|
1382
1371
|
|
|
1383
|
-
/***/ }),
|
|
1384
|
-
|
|
1385
|
-
/***/ "7dd7":
|
|
1386
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1387
|
-
|
|
1388
|
-
// extracted by mini-css-extract-plugin
|
|
1389
|
-
|
|
1390
1372
|
/***/ }),
|
|
1391
1373
|
|
|
1392
1374
|
/***/ "8085":
|
|
@@ -1636,6 +1618,17 @@ module.exports = store.inspectSource;
|
|
|
1636
1618
|
|
|
1637
1619
|
module.exports = require("vue");
|
|
1638
1620
|
|
|
1621
|
+
/***/ }),
|
|
1622
|
+
|
|
1623
|
+
/***/ "8d6c":
|
|
1624
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1625
|
+
|
|
1626
|
+
"use strict";
|
|
1627
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_28cf6cc1_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("de1e");
|
|
1628
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_28cf6cc1_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_28cf6cc1_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
|
|
1629
|
+
/* unused harmony reexport * */
|
|
1630
|
+
|
|
1631
|
+
|
|
1639
1632
|
/***/ }),
|
|
1640
1633
|
|
|
1641
1634
|
/***/ "8dbb":
|
|
@@ -2040,6 +2033,13 @@ module.exports = function (name) {
|
|
|
2040
2033
|
/* unused harmony reexport * */
|
|
2041
2034
|
|
|
2042
2035
|
|
|
2036
|
+
/***/ }),
|
|
2037
|
+
|
|
2038
|
+
/***/ "c028":
|
|
2039
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2040
|
+
|
|
2041
|
+
// extracted by mini-css-extract-plugin
|
|
2042
|
+
|
|
2043
2043
|
/***/ }),
|
|
2044
2044
|
|
|
2045
2045
|
/***/ "c04e":
|
|
@@ -2404,6 +2404,17 @@ exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
|
2404
2404
|
} : $propertyIsEnumerable;
|
|
2405
2405
|
|
|
2406
2406
|
|
|
2407
|
+
/***/ }),
|
|
2408
|
+
|
|
2409
|
+
/***/ "d831":
|
|
2410
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2411
|
+
|
|
2412
|
+
"use strict";
|
|
2413
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_FormWysiwyg_vue_vue_type_style_index_0_id_52b4ebd4_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("c028");
|
|
2414
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_FormWysiwyg_vue_vue_type_style_index_0_id_52b4ebd4_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_FormWysiwyg_vue_vue_type_style_index_0_id_52b4ebd4_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
|
|
2415
|
+
/* unused harmony reexport * */
|
|
2416
|
+
|
|
2417
|
+
|
|
2407
2418
|
/***/ }),
|
|
2408
2419
|
|
|
2409
2420
|
/***/ "d9b5":
|
|
@@ -2466,6 +2477,13 @@ module.exports = function (V, P) {
|
|
|
2466
2477
|
/* unused harmony reexport * */
|
|
2467
2478
|
|
|
2468
2479
|
|
|
2480
|
+
/***/ }),
|
|
2481
|
+
|
|
2482
|
+
/***/ "de1e":
|
|
2483
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2484
|
+
|
|
2485
|
+
// extracted by mini-css-extract-plugin
|
|
2486
|
+
|
|
2469
2487
|
/***/ }),
|
|
2470
2488
|
|
|
2471
2489
|
/***/ "e330":
|
|
@@ -2686,6 +2704,7 @@ __webpack_require__.d(__webpack_exports__, "DropdownCompany", function() { retur
|
|
|
2686
2704
|
__webpack_require__.d(__webpack_exports__, "ModalDialog", function() { return /* reexport */ ModalDialog; });
|
|
2687
2705
|
__webpack_require__.d(__webpack_exports__, "FormInputTag", function() { return /* reexport */ FormInputTag; });
|
|
2688
2706
|
__webpack_require__.d(__webpack_exports__, "FormTextarea", function() { return /* reexport */ FormTextarea; });
|
|
2707
|
+
__webpack_require__.d(__webpack_exports__, "FormWysiwyg", function() { return /* reexport */ FormWysiwyg; });
|
|
2689
2708
|
__webpack_require__.d(__webpack_exports__, "ExpansionPanel", function() { return /* reexport */ ExpansionPanel; });
|
|
2690
2709
|
__webpack_require__.d(__webpack_exports__, "AnimatedIconLogo", function() { return /* reexport */ AnimatedIconLogo; });
|
|
2691
2710
|
|
|
@@ -36842,16 +36861,16 @@ var DashboardFootervue_type_style_index_0_id_2dbadb09_lang_scss = __webpack_requ
|
|
|
36842
36861
|
const DashboardFooter_exports_ = /*#__PURE__*/exportHelper_default()(DashboardFootervue_type_script_lang_js, [['render',DashboardFootervue_type_template_id_2dbadb09_render]])
|
|
36843
36862
|
|
|
36844
36863
|
/* harmony default export */ var DashboardFooter = (DashboardFooter_exports_);
|
|
36845
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/DashboardHeader/index.vue?vue&type=template&id=
|
|
36864
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/DashboardHeader/index.vue?vue&type=template&id=28cf6cc1
|
|
36846
36865
|
|
|
36847
|
-
const
|
|
36866
|
+
const DashboardHeadervue_type_template_id_28cf6cc1_hoisted_1 = {
|
|
36848
36867
|
class: "dashboard-header box-shadow"
|
|
36849
36868
|
};
|
|
36850
|
-
const
|
|
36869
|
+
const DashboardHeadervue_type_template_id_28cf6cc1_hoisted_2 = {
|
|
36851
36870
|
key: 0,
|
|
36852
36871
|
class: "header-left"
|
|
36853
36872
|
};
|
|
36854
|
-
const
|
|
36873
|
+
const DashboardHeadervue_type_template_id_28cf6cc1_hoisted_3 = {
|
|
36855
36874
|
class: "company-name"
|
|
36856
36875
|
};
|
|
36857
36876
|
const _hoisted_4 = {
|
|
@@ -36873,49 +36892,76 @@ const _hoisted_9 = {
|
|
|
36873
36892
|
class: "header-right relative"
|
|
36874
36893
|
};
|
|
36875
36894
|
const _hoisted_10 = {
|
|
36876
|
-
class: "notification"
|
|
36895
|
+
class: "notification-wrapper"
|
|
36877
36896
|
};
|
|
36878
36897
|
const _hoisted_11 = {
|
|
36879
|
-
|
|
36898
|
+
key: 0,
|
|
36899
|
+
class: "notif-dot"
|
|
36880
36900
|
};
|
|
36881
36901
|
const _hoisted_12 = {
|
|
36882
|
-
|
|
36902
|
+
key: 0,
|
|
36903
|
+
class: "notification-dropdown box-shadow"
|
|
36883
36904
|
};
|
|
36884
36905
|
const _hoisted_13 = {
|
|
36906
|
+
key: 0,
|
|
36907
|
+
class: "notification-list"
|
|
36908
|
+
};
|
|
36909
|
+
const _hoisted_14 = ["onClick"];
|
|
36910
|
+
const _hoisted_15 = {
|
|
36911
|
+
class: "notification-item-content"
|
|
36912
|
+
};
|
|
36913
|
+
const _hoisted_16 = {
|
|
36914
|
+
class: "notification-item-title"
|
|
36915
|
+
};
|
|
36916
|
+
const _hoisted_17 = {
|
|
36917
|
+
key: 0,
|
|
36918
|
+
class: "notification-item-meta"
|
|
36919
|
+
};
|
|
36920
|
+
const _hoisted_18 = {
|
|
36921
|
+
key: 1,
|
|
36922
|
+
class: "notification-empty"
|
|
36923
|
+
};
|
|
36924
|
+
const _hoisted_19 = {
|
|
36925
|
+
class: "avatar"
|
|
36926
|
+
};
|
|
36927
|
+
const _hoisted_20 = {
|
|
36928
|
+
class: "user-text"
|
|
36929
|
+
};
|
|
36930
|
+
const _hoisted_21 = {
|
|
36885
36931
|
class: "user-name"
|
|
36886
36932
|
};
|
|
36887
|
-
const
|
|
36933
|
+
const _hoisted_22 = {
|
|
36888
36934
|
class: "user-role"
|
|
36889
36935
|
};
|
|
36890
|
-
const
|
|
36936
|
+
const _hoisted_23 = {
|
|
36891
36937
|
key: 0,
|
|
36892
|
-
class: "absolute top-8 right-0"
|
|
36938
|
+
class: "absolute top-8 right-0 user-dropdown-wrapper"
|
|
36893
36939
|
};
|
|
36894
|
-
const
|
|
36940
|
+
const _hoisted_24 = {
|
|
36895
36941
|
class: "dropdown-panel box-shadow bg-white"
|
|
36896
36942
|
};
|
|
36897
|
-
const
|
|
36943
|
+
const _hoisted_25 = {
|
|
36898
36944
|
class: "flex flex-col p-3",
|
|
36899
36945
|
style: {
|
|
36900
36946
|
"border-bottom": "1px solid #DDDDDD"
|
|
36901
36947
|
}
|
|
36902
36948
|
};
|
|
36903
|
-
const
|
|
36949
|
+
const _hoisted_26 = {
|
|
36904
36950
|
class: "flex flex-row items-center mb-4"
|
|
36905
36951
|
};
|
|
36906
|
-
const
|
|
36952
|
+
const _hoisted_27 = {
|
|
36907
36953
|
class: "avatar mr-3"
|
|
36908
36954
|
};
|
|
36909
|
-
const
|
|
36955
|
+
const _hoisted_28 = {
|
|
36910
36956
|
class: "flex flex-col"
|
|
36911
36957
|
};
|
|
36912
|
-
const
|
|
36913
|
-
function
|
|
36958
|
+
const _hoisted_29 = ["onClick"];
|
|
36959
|
+
function DashboardHeadervue_type_template_id_28cf6cc1_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
36914
36960
|
const _component_base_icon = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("base-icon");
|
|
36915
36961
|
const _component_dropdown_company = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("dropdown-company");
|
|
36916
36962
|
const _component_typo_text = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("typo-text");
|
|
36917
36963
|
const _component_base_button = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("base-button");
|
|
36918
|
-
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div",
|
|
36964
|
+
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", DashboardHeadervue_type_template_id_28cf6cc1_hoisted_1, [$props.showCompany ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", DashboardHeadervue_type_template_id_28cf6cc1_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_dropdown_company, {
|
|
36919
36965
|
options: $props.companyList,
|
|
36920
36966
|
style: {
|
|
36921
36967
|
"width": "100%",
|
|
@@ -36934,7 +36980,7 @@ function DashboardHeadervue_type_template_id_faab9602_render(_ctx, _cache, $prop
|
|
|
36934
36980
|
}, {
|
|
36935
36981
|
list: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(({
|
|
36936
36982
|
item
|
|
36937
|
-
}) => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p",
|
|
36983
|
+
}) => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", DashboardHeadervue_type_template_id_28cf6cc1_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.companyName), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.companyNpwp), 1)]),
|
|
36938
36984
|
label: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(slotProps => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])($props.selectedCompany.companyName), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_8, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])($props.selectedCompany.companyNpwp), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_base_icon, {
|
|
36939
36985
|
iconName: "expand_more",
|
|
36940
36986
|
class: "chevron",
|
|
@@ -36943,25 +36989,40 @@ function DashboardHeadervue_type_template_id_faab9602_render(_ctx, _cache, $prop
|
|
|
36943
36989
|
})
|
|
36944
36990
|
}, null, 8, ["style"])])]),
|
|
36945
36991
|
_: 1
|
|
36946
|
-
}, 8, ["options", "onChange", "enableInfiniteScroll", "hasMore", "isLoadingMore", "scrollThreshold", "onLoadMore"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["
|
|
36992
|
+
}, 8, ["options", "onChange", "enableInfiniteScroll", "hasMore", "isLoadingMore", "scrollThreshold", "onLoadMore"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
|
|
36993
|
+
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["notification", {
|
|
36994
|
+
active: $data.showNotification
|
|
36995
|
+
}]),
|
|
36996
|
+
onClick: _cache[0] || (_cache[0] = (...args) => $options.toggleNotificationMenu && $options.toggleNotificationMenu(...args))
|
|
36997
|
+
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_base_icon, {
|
|
36947
36998
|
iconName: "notifications_none"
|
|
36948
|
-
}),
|
|
36949
|
-
|
|
36950
|
-
|
|
36999
|
+
}), $options.hasNotifications ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", _hoisted_11)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2), $data.showNotification ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_12, [$options.hasNotifications ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_13, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])($options.notificationItems, item => {
|
|
37000
|
+
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", {
|
|
37001
|
+
key: item.id,
|
|
37002
|
+
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["notification-item", $options.notificationSeverityClass(item)]),
|
|
37003
|
+
onClick: $event => $options.onNotificationClick(item)
|
|
37004
|
+
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_base_icon, {
|
|
37005
|
+
iconName: $options.notificationIcon(item),
|
|
37006
|
+
color: $options.notificationColor(item),
|
|
37007
|
+
class: "notification-item-icon",
|
|
37008
|
+
width: "20px",
|
|
37009
|
+
height: "20px"
|
|
37010
|
+
}, null, 8, ["iconName", "color"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_16, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.title), 1), item.periodLabel ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_17, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.periodLabel), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 10, _hoisted_14);
|
|
37011
|
+
}), 128))])) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_18, " Tidak ada notifikasi "))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), _cache[5] || (_cache[5] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
|
|
36951
37012
|
class: "divider"
|
|
36952
37013
|
}, null, -1)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
|
|
36953
37014
|
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["user-summary", {
|
|
36954
37015
|
active: $data.show
|
|
36955
37016
|
}]),
|
|
36956
|
-
onClick: _cache[
|
|
36957
|
-
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div",
|
|
37017
|
+
onClick: _cache[1] || (_cache[1] = (...args) => $options.toggleMenu && $options.toggleMenu(...args))
|
|
37018
|
+
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_19, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])($options.initialName), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_20, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_21, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])($props.userName), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_22, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])($props.userRole), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_base_icon, {
|
|
36958
37019
|
iconName: "expand_more",
|
|
36959
37020
|
class: "caret",
|
|
36960
37021
|
color: "#90A1B9",
|
|
36961
37022
|
style: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeStyle"])({
|
|
36962
37023
|
transform: $data.show ? 'rotate(180deg)' : 'rotate(0deg)'
|
|
36963
37024
|
})
|
|
36964
|
-
}, null, 8, ["style"])], 2), $data.show ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div",
|
|
37025
|
+
}, null, 8, ["style"])], 2), $data.show ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_23, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_24, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_25, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_26, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_27, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])($options.initialName), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_typo_text, {
|
|
36965
37026
|
variant: "body-1-bold",
|
|
36966
37027
|
class: "capitalize"
|
|
36967
37028
|
}, {
|
|
@@ -36977,11 +37038,11 @@ function DashboardHeadervue_type_template_id_faab9602_render(_ctx, _cache, $prop
|
|
|
36977
37038
|
})) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_base_button, {
|
|
36978
37039
|
variant: "secondary",
|
|
36979
37040
|
class: "justify-center",
|
|
36980
|
-
onClick: _cache[
|
|
37041
|
+
onClick: _cache[2] || (_cache[2] = $event => $options.actionRoute('edit-profile'))
|
|
36981
37042
|
}, {
|
|
36982
37043
|
default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => _cache[4] || (_cache[4] = [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" Ubah Profil ")])),
|
|
36983
37044
|
_: 1
|
|
36984
|
-
})]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div",
|
|
37045
|
+
})]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_28, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])($props.menuNavbar, (item, index) => {
|
|
36985
37046
|
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", {
|
|
36986
37047
|
key: index,
|
|
36987
37048
|
class: "p-4 cursor-pointer item-menu flex",
|
|
@@ -36990,13 +37051,14 @@ function DashboardHeadervue_type_template_id_faab9602_render(_ctx, _cache, $prop
|
|
|
36990
37051
|
key: 0,
|
|
36991
37052
|
iconName: item.icon,
|
|
36992
37053
|
class: "mr-2"
|
|
36993
|
-
}, null, 8, ["iconName"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.name), 1)], 8,
|
|
36994
|
-
}), 128))])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["
|
|
37054
|
+
}, null, 8, ["iconName"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.name), 1)], 8, _hoisted_29);
|
|
37055
|
+
}), 128))])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), $data.show || $data.showNotification ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", {
|
|
37056
|
+
key: 1,
|
|
36995
37057
|
class: "overlay",
|
|
36996
|
-
onClick: _cache[
|
|
36997
|
-
})
|
|
37058
|
+
onClick: _cache[3] || (_cache[3] = (...args) => $options.closeAllMenus && $options.closeAllMenus(...args))
|
|
37059
|
+
})) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])]);
|
|
36998
37060
|
}
|
|
36999
|
-
// CONCATENATED MODULE: ./src/components/DashboardHeader/index.vue?vue&type=template&id=
|
|
37061
|
+
// CONCATENATED MODULE: ./src/components/DashboardHeader/index.vue?vue&type=template&id=28cf6cc1
|
|
37000
37062
|
|
|
37001
37063
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/Dropdown/DropdownCompany.vue?vue&type=template&id=267c0afa
|
|
37002
37064
|
|
|
@@ -37289,11 +37351,16 @@ var js_cookie_default = /*#__PURE__*/__webpack_require__.n(js_cookie);
|
|
|
37289
37351
|
companyScrollThreshold: {
|
|
37290
37352
|
type: Number,
|
|
37291
37353
|
default: 40
|
|
37354
|
+
},
|
|
37355
|
+
notifications: {
|
|
37356
|
+
type: Array,
|
|
37357
|
+
default: () => []
|
|
37292
37358
|
}
|
|
37293
37359
|
},
|
|
37294
37360
|
data() {
|
|
37295
37361
|
return {
|
|
37296
37362
|
show: false,
|
|
37363
|
+
showNotification: false,
|
|
37297
37364
|
logoutTimeout: null
|
|
37298
37365
|
};
|
|
37299
37366
|
},
|
|
@@ -37310,6 +37377,16 @@ var js_cookie_default = /*#__PURE__*/__webpack_require__.n(js_cookie);
|
|
|
37310
37377
|
initials = initials.toUpperCase();
|
|
37311
37378
|
}
|
|
37312
37379
|
return initials;
|
|
37380
|
+
},
|
|
37381
|
+
hasNotifications() {
|
|
37382
|
+
return this.notificationItems.length > 0;
|
|
37383
|
+
},
|
|
37384
|
+
notificationItems() {
|
|
37385
|
+
if (!Array.isArray(this.notifications)) return [];
|
|
37386
|
+
return [...this.notifications].sort((a, b) => {
|
|
37387
|
+
var _a$priority, _b$priority;
|
|
37388
|
+
return ((_a$priority = a === null || a === void 0 ? void 0 : a.priority) !== null && _a$priority !== void 0 ? _a$priority : 0) - ((_b$priority = b === null || b === void 0 ? void 0 : b.priority) !== null && _b$priority !== void 0 ? _b$priority : 0);
|
|
37389
|
+
});
|
|
37313
37390
|
}
|
|
37314
37391
|
},
|
|
37315
37392
|
watch: {
|
|
@@ -37325,11 +37402,21 @@ var js_cookie_default = /*#__PURE__*/__webpack_require__.n(js_cookie);
|
|
|
37325
37402
|
},
|
|
37326
37403
|
methods: {
|
|
37327
37404
|
toggleMenu() {
|
|
37405
|
+
this.showNotification = false;
|
|
37328
37406
|
this.show = !this.show;
|
|
37329
37407
|
},
|
|
37408
|
+
toggleNotificationMenu() {
|
|
37409
|
+
this.show = false;
|
|
37410
|
+
this.showNotification = !this.showNotification;
|
|
37411
|
+
},
|
|
37412
|
+
closeAllMenus() {
|
|
37413
|
+
this.show = false;
|
|
37414
|
+
this.showNotification = false;
|
|
37415
|
+
},
|
|
37330
37416
|
actionRoute(value) {
|
|
37331
37417
|
this.$emit("actionRoute", value);
|
|
37332
37418
|
this.show = false;
|
|
37419
|
+
this.showNotification = false;
|
|
37333
37420
|
},
|
|
37334
37421
|
setSelectedCompany(value) {
|
|
37335
37422
|
this.$emit("setSelectedCompany", value);
|
|
@@ -37394,13 +37481,60 @@ var js_cookie_default = /*#__PURE__*/__webpack_require__.n(js_cookie);
|
|
|
37394
37481
|
} else {
|
|
37395
37482
|
clearTimeout(this.logoutTimeout);
|
|
37396
37483
|
}
|
|
37484
|
+
},
|
|
37485
|
+
notificationSeverityClass(item) {
|
|
37486
|
+
const severity = item && item.severity ? item.severity : "default";
|
|
37487
|
+
return `severity-${severity}`;
|
|
37488
|
+
},
|
|
37489
|
+
notificationIcon(item) {
|
|
37490
|
+
if (item && item.icon) return item.icon;
|
|
37491
|
+
if (item && item.severity === "danger") return "error_outline";
|
|
37492
|
+
if (item && item.severity === "warning") return "warning";
|
|
37493
|
+
return "notifications_none";
|
|
37494
|
+
},
|
|
37495
|
+
notificationColor(item) {
|
|
37496
|
+
if (item && item.severity === "danger") return "#E64C4C";
|
|
37497
|
+
if (item && item.severity === "warning") return "#F4A51C";
|
|
37498
|
+
return "#7A8595";
|
|
37499
|
+
},
|
|
37500
|
+
moduleBaseUrl() {
|
|
37501
|
+
return this.moduleApp ? this.moduleApp.replace(/\/+$/, "") : "";
|
|
37502
|
+
},
|
|
37503
|
+
buildRoute(path) {
|
|
37504
|
+
if (!path) return "";
|
|
37505
|
+
const cleanPath = String(path).replace(/^\/+/, "");
|
|
37506
|
+
const baseUrl = this.moduleBaseUrl();
|
|
37507
|
+
return baseUrl ? `${baseUrl}/${cleanPath}` : `/${cleanPath}`;
|
|
37508
|
+
},
|
|
37509
|
+
onNotificationClick(item) {
|
|
37510
|
+
const actionMap = {
|
|
37511
|
+
"verifikasi-email": "akun",
|
|
37512
|
+
"verifikasi-phone": "akun",
|
|
37513
|
+
pic: "manajemen-perusahaan/pic",
|
|
37514
|
+
signer: "manajemen-perusahaan/penandatangan"
|
|
37515
|
+
};
|
|
37516
|
+
if (item.actionKey === "company-invitation") {
|
|
37517
|
+
this.$emit("notificationAction", item);
|
|
37518
|
+
this.showNotification = false;
|
|
37519
|
+
return;
|
|
37520
|
+
}
|
|
37521
|
+
if (item.actionKey === "transaksi" && item.url) {
|
|
37522
|
+
window.location.href = item.url;
|
|
37523
|
+
this.showNotification = false;
|
|
37524
|
+
return;
|
|
37525
|
+
}
|
|
37526
|
+
const path = actionMap[item.actionKey];
|
|
37527
|
+
if (path) {
|
|
37528
|
+
window.location.href = this.buildRoute(path);
|
|
37529
|
+
}
|
|
37530
|
+
this.showNotification = false;
|
|
37397
37531
|
}
|
|
37398
37532
|
}
|
|
37399
37533
|
});
|
|
37400
37534
|
// CONCATENATED MODULE: ./src/components/DashboardHeader/index.vue?vue&type=script&lang=js
|
|
37401
37535
|
|
|
37402
|
-
// EXTERNAL MODULE: ./src/components/DashboardHeader/index.vue?vue&type=style&index=0&id=
|
|
37403
|
-
var
|
|
37536
|
+
// EXTERNAL MODULE: ./src/components/DashboardHeader/index.vue?vue&type=style&index=0&id=28cf6cc1&lang=scss
|
|
37537
|
+
var DashboardHeadervue_type_style_index_0_id_28cf6cc1_lang_scss = __webpack_require__("8d6c");
|
|
37404
37538
|
|
|
37405
37539
|
// CONCATENATED MODULE: ./src/components/DashboardHeader/index.vue
|
|
37406
37540
|
|
|
@@ -37410,7 +37544,7 @@ var DashboardHeadervue_type_style_index_0_id_faab9602_lang_scss = __webpack_requ
|
|
|
37410
37544
|
|
|
37411
37545
|
|
|
37412
37546
|
|
|
37413
|
-
const DashboardHeader_exports_ = /*#__PURE__*/exportHelper_default()(DashboardHeadervue_type_script_lang_js, [['render',
|
|
37547
|
+
const DashboardHeader_exports_ = /*#__PURE__*/exportHelper_default()(DashboardHeadervue_type_script_lang_js, [['render',DashboardHeadervue_type_template_id_28cf6cc1_render]])
|
|
37414
37548
|
|
|
37415
37549
|
/* harmony default export */ var DashboardHeader = (DashboardHeader_exports_);
|
|
37416
37550
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/DatePicker/index.vue?vue&type=template&id=dd52aaa6
|
|
@@ -37478,28 +37612,28 @@ const DatePickervue_type_template_id_dd52aaa6_hoisted_20 = {
|
|
|
37478
37612
|
class: "weekdays"
|
|
37479
37613
|
};
|
|
37480
37614
|
const DatePickervue_type_template_id_dd52aaa6_hoisted_21 = ["onClick", "onMouseenter"];
|
|
37481
|
-
const
|
|
37615
|
+
const DatePickervue_type_template_id_dd52aaa6_hoisted_22 = {
|
|
37482
37616
|
key: 2,
|
|
37483
37617
|
class: "flex flex-wrap items-center wrap-month"
|
|
37484
37618
|
};
|
|
37485
|
-
const
|
|
37486
|
-
const
|
|
37619
|
+
const DatePickervue_type_template_id_dd52aaa6_hoisted_23 = ["onClick"];
|
|
37620
|
+
const DatePickervue_type_template_id_dd52aaa6_hoisted_24 = {
|
|
37487
37621
|
key: 3,
|
|
37488
37622
|
class: "flex flex-wrap items-center wrap-month"
|
|
37489
37623
|
};
|
|
37490
|
-
const
|
|
37491
|
-
const
|
|
37624
|
+
const DatePickervue_type_template_id_dd52aaa6_hoisted_25 = ["onClick"];
|
|
37625
|
+
const DatePickervue_type_template_id_dd52aaa6_hoisted_26 = {
|
|
37492
37626
|
key: 3,
|
|
37493
37627
|
class: "px-6 pb-5 wrap-action-footer"
|
|
37494
37628
|
};
|
|
37495
|
-
const
|
|
37629
|
+
const DatePickervue_type_template_id_dd52aaa6_hoisted_27 = {
|
|
37496
37630
|
key: 1
|
|
37497
37631
|
};
|
|
37498
|
-
const
|
|
37632
|
+
const DatePickervue_type_template_id_dd52aaa6_hoisted_28 = {
|
|
37499
37633
|
key: 0,
|
|
37500
37634
|
class: "date-picker range-picker"
|
|
37501
37635
|
};
|
|
37502
|
-
const
|
|
37636
|
+
const DatePickervue_type_template_id_dd52aaa6_hoisted_29 = {
|
|
37503
37637
|
class: "calendar flex flex-row"
|
|
37504
37638
|
};
|
|
37505
37639
|
const _hoisted_30 = {
|
|
@@ -37685,7 +37819,7 @@ function DatePickervue_type_template_id_dd52aaa6_render(_ctx, _cache, $props, $s
|
|
|
37685
37819
|
})
|
|
37686
37820
|
}, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(day.label), 3)], 42, DatePickervue_type_template_id_dd52aaa6_hoisted_21);
|
|
37687
37821
|
}), 128))]);
|
|
37688
|
-
}), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), $props.pickerType == 'month' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div",
|
|
37822
|
+
}), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), $props.pickerType == 'month' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", DatePickervue_type_template_id_dd52aaa6_hoisted_22, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])($options.months, (item, index) => {
|
|
37689
37823
|
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", {
|
|
37690
37824
|
key: index,
|
|
37691
37825
|
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["month", {
|
|
@@ -37697,8 +37831,8 @@ function DatePickervue_type_template_id_dd52aaa6_render(_ctx, _cache, $props, $s
|
|
|
37697
37831
|
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])({
|
|
37698
37832
|
today: item.isToday
|
|
37699
37833
|
})
|
|
37700
|
-
}, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.label), 3)], 10,
|
|
37701
|
-
}), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), $props.pickerType == 'year' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div",
|
|
37834
|
+
}, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.label), 3)], 10, DatePickervue_type_template_id_dd52aaa6_hoisted_23);
|
|
37835
|
+
}), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), $props.pickerType == 'year' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", DatePickervue_type_template_id_dd52aaa6_hoisted_24, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])($options.listYear, (item, index) => {
|
|
37702
37836
|
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", {
|
|
37703
37837
|
key: index,
|
|
37704
37838
|
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["month", {
|
|
@@ -37710,8 +37844,8 @@ function DatePickervue_type_template_id_dd52aaa6_render(_ctx, _cache, $props, $s
|
|
|
37710
37844
|
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])({
|
|
37711
37845
|
today: item.isToday
|
|
37712
37846
|
})
|
|
37713
|
-
}, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.year), 3)], 10,
|
|
37714
|
-
}), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])), $data.slotActionFooter ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div",
|
|
37847
|
+
}, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.year), 3)], 10, DatePickervue_type_template_id_dd52aaa6_hoisted_25);
|
|
37848
|
+
}), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])), $data.slotActionFooter ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", DatePickervue_type_template_id_dd52aaa6_hoisted_26, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "actionFooter")])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), $props.mode == 'range' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", DatePickervue_type_template_id_dd52aaa6_hoisted_27, [$props.pickerType == 'day' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", DatePickervue_type_template_id_dd52aaa6_hoisted_28, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", DatePickervue_type_template_id_dd52aaa6_hoisted_29, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_30, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_31, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_typo_text, {
|
|
37715
37849
|
variant: "body-2-bold",
|
|
37716
37850
|
class: "mb-2"
|
|
37717
37851
|
}, {
|
|
@@ -42072,6 +42206,945 @@ var FormTextareavue_type_style_index_0_id_4b6a6dc5_lang_scss = __webpack_require
|
|
|
42072
42206
|
const FormTextarea_exports_ = /*#__PURE__*/exportHelper_default()(FormTextareavue_type_script_lang_js, [['render',FormTextareavue_type_template_id_4b6a6dc5_render]])
|
|
42073
42207
|
|
|
42074
42208
|
/* harmony default export */ var FormTextarea = (FormTextarea_exports_);
|
|
42209
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/Form/FormWysiwyg.vue?vue&type=template&id=52b4ebd4
|
|
42210
|
+
|
|
42211
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_1 = {
|
|
42212
|
+
class: "form-wysiwyg flex flex-col"
|
|
42213
|
+
};
|
|
42214
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_2 = {
|
|
42215
|
+
class: "w-full"
|
|
42216
|
+
};
|
|
42217
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_3 = {
|
|
42218
|
+
key: 0,
|
|
42219
|
+
class: "toolbar"
|
|
42220
|
+
};
|
|
42221
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_4 = {
|
|
42222
|
+
key: 0,
|
|
42223
|
+
class: "toolbar-divider"
|
|
42224
|
+
};
|
|
42225
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_5 = ["disabled", "title", "onClick"];
|
|
42226
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_6 = {
|
|
42227
|
+
key: 1,
|
|
42228
|
+
class: "toolbar-text"
|
|
42229
|
+
};
|
|
42230
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_7 = ["contenteditable", "data-placeholder"];
|
|
42231
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_8 = ["innerHTML"];
|
|
42232
|
+
function FormWysiwygvue_type_template_id_52b4ebd4_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
42233
|
+
const _component_base_icon = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("base-icon");
|
|
42234
|
+
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FormWysiwygvue_type_template_id_52b4ebd4_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
|
|
42235
|
+
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(`label-${$props.labelPosition}`)
|
|
42236
|
+
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "label"), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", FormWysiwygvue_type_template_id_52b4ebd4_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
|
|
42237
|
+
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["editor-group", {
|
|
42238
|
+
error: $props.error,
|
|
42239
|
+
disabled: $props.disabled,
|
|
42240
|
+
readonly: $props.readonly && !$props.disabled
|
|
42241
|
+
}])
|
|
42242
|
+
}, [$props.showToolbar ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FormWysiwygvue_type_template_id_52b4ebd4_hoisted_3, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])($options.resolvedToolbar, (item, index) => {
|
|
42243
|
+
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], {
|
|
42244
|
+
key: `${item.action}-${index}`
|
|
42245
|
+
}, [item.action === 'divider' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FormWysiwygvue_type_template_id_52b4ebd4_hoisted_4)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("button", {
|
|
42246
|
+
key: 1,
|
|
42247
|
+
type: "button",
|
|
42248
|
+
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["toolbar-button", {
|
|
42249
|
+
active: $options.isActionActive(item)
|
|
42250
|
+
}]),
|
|
42251
|
+
disabled: $options.isActionDisabled(item),
|
|
42252
|
+
title: item.title || item.label,
|
|
42253
|
+
onMousedown: _cache[0] || (_cache[0] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(() => {}, ["prevent"])),
|
|
42254
|
+
onClick: $event => $options.handleToolbarAction(item)
|
|
42255
|
+
}, [item.icon ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_base_icon, {
|
|
42256
|
+
key: 0,
|
|
42257
|
+
iconName: item.icon,
|
|
42258
|
+
width: "18",
|
|
42259
|
+
height: "18",
|
|
42260
|
+
color: $options.isActionActive(item) ? '#3e7dc0' : '#59636E'
|
|
42261
|
+
}, null, 8, ["iconName", "color"])) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", FormWysiwygvue_type_template_id_52b4ebd4_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.label), 1))], 42, FormWysiwygvue_type_template_id_52b4ebd4_hoisted_5))], 64);
|
|
42262
|
+
}), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", {
|
|
42263
|
+
ref: "imageInputRef",
|
|
42264
|
+
type: "file",
|
|
42265
|
+
class: "image-input",
|
|
42266
|
+
accept: "image/*",
|
|
42267
|
+
onChange: _cache[1] || (_cache[1] = (...args) => $options.handleImageSelected && $options.handleImageSelected(...args))
|
|
42268
|
+
}, null, 544), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
|
|
42269
|
+
class: "editor-wrapper",
|
|
42270
|
+
style: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeStyle"])($options.editorStyle)
|
|
42271
|
+
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
|
|
42272
|
+
ref: "editorRef",
|
|
42273
|
+
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["editor-area", {
|
|
42274
|
+
'is-empty': $data.isEmpty
|
|
42275
|
+
}]),
|
|
42276
|
+
contenteditable: $options.isEditable,
|
|
42277
|
+
"data-placeholder": $props.placeholder,
|
|
42278
|
+
onInput: _cache[2] || (_cache[2] = (...args) => $options.handleInput && $options.handleInput(...args)),
|
|
42279
|
+
onFocus: _cache[3] || (_cache[3] = (...args) => $options.handleFocus && $options.handleFocus(...args)),
|
|
42280
|
+
onBlur: _cache[4] || (_cache[4] = (...args) => $options.handleBlur && $options.handleBlur(...args)),
|
|
42281
|
+
onPaste: _cache[5] || (_cache[5] = (...args) => $options.handlePaste && $options.handlePaste(...args)),
|
|
42282
|
+
onMouseup: _cache[6] || (_cache[6] = (...args) => $options.refreshToolbarState && $options.refreshToolbarState(...args)),
|
|
42283
|
+
onKeyup: _cache[7] || (_cache[7] = (...args) => $options.refreshToolbarState && $options.refreshToolbarState(...args)),
|
|
42284
|
+
onMousedown: _cache[8] || (_cache[8] = (...args) => $options.handleEditorMouseDown && $options.handleEditorMouseDown(...args)),
|
|
42285
|
+
onMousemove: _cache[9] || (_cache[9] = (...args) => $options.handleEditorMouseMove && $options.handleEditorMouseMove(...args)),
|
|
42286
|
+
onMouseleave: _cache[10] || (_cache[10] = (...args) => $options.handleEditorMouseLeave && $options.handleEditorMouseLeave(...args))
|
|
42287
|
+
}, null, 42, FormWysiwygvue_type_template_id_52b4ebd4_hoisted_7)], 4)], 2), $props.message ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", {
|
|
42288
|
+
key: 0,
|
|
42289
|
+
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["helper-text", {
|
|
42290
|
+
'error-helper': $props.error
|
|
42291
|
+
}])
|
|
42292
|
+
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
|
|
42293
|
+
innerHTML: $props.message
|
|
42294
|
+
}, null, 8, FormWysiwygvue_type_template_id_52b4ebd4_hoisted_8)], 2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 2)]);
|
|
42295
|
+
}
|
|
42296
|
+
// CONCATENATED MODULE: ./src/components/Form/FormWysiwyg.vue?vue&type=template&id=52b4ebd4
|
|
42297
|
+
|
|
42298
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/Form/FormWysiwyg.vue?vue&type=script&lang=js
|
|
42299
|
+
|
|
42300
|
+
const TOOLBAR_ITEMS = {
|
|
42301
|
+
paragraph: {
|
|
42302
|
+
action: "paragraph",
|
|
42303
|
+
label: "P",
|
|
42304
|
+
title: "Paragraph"
|
|
42305
|
+
},
|
|
42306
|
+
heading1: {
|
|
42307
|
+
action: "heading1",
|
|
42308
|
+
label: "H1",
|
|
42309
|
+
title: "Heading 1"
|
|
42310
|
+
},
|
|
42311
|
+
heading2: {
|
|
42312
|
+
action: "heading2",
|
|
42313
|
+
label: "H2",
|
|
42314
|
+
title: "Heading 2"
|
|
42315
|
+
},
|
|
42316
|
+
bold: {
|
|
42317
|
+
action: "bold",
|
|
42318
|
+
icon: "format_bold",
|
|
42319
|
+
title: "Bold"
|
|
42320
|
+
},
|
|
42321
|
+
italic: {
|
|
42322
|
+
action: "italic",
|
|
42323
|
+
icon: "format_italic",
|
|
42324
|
+
title: "Italic"
|
|
42325
|
+
},
|
|
42326
|
+
underline: {
|
|
42327
|
+
action: "underline",
|
|
42328
|
+
icon: "format_underlined",
|
|
42329
|
+
title: "Underline"
|
|
42330
|
+
},
|
|
42331
|
+
strikeThrough: {
|
|
42332
|
+
action: "strikeThrough",
|
|
42333
|
+
icon: "strikethrough_s",
|
|
42334
|
+
title: "Strikethrough"
|
|
42335
|
+
},
|
|
42336
|
+
unorderedList: {
|
|
42337
|
+
action: "unorderedList",
|
|
42338
|
+
icon: "format_list_bulleted",
|
|
42339
|
+
title: "Bullet List"
|
|
42340
|
+
},
|
|
42341
|
+
orderedList: {
|
|
42342
|
+
action: "orderedList",
|
|
42343
|
+
icon: "format_list_numbered",
|
|
42344
|
+
title: "Numbered List"
|
|
42345
|
+
},
|
|
42346
|
+
blockquote: {
|
|
42347
|
+
action: "blockquote",
|
|
42348
|
+
icon: "format_quote",
|
|
42349
|
+
title: "Quote"
|
|
42350
|
+
},
|
|
42351
|
+
alignLeft: {
|
|
42352
|
+
action: "alignLeft",
|
|
42353
|
+
icon: "format_align_left",
|
|
42354
|
+
title: "Align Left"
|
|
42355
|
+
},
|
|
42356
|
+
alignCenter: {
|
|
42357
|
+
action: "alignCenter",
|
|
42358
|
+
icon: "format_align_center",
|
|
42359
|
+
title: "Align Center"
|
|
42360
|
+
},
|
|
42361
|
+
alignRight: {
|
|
42362
|
+
action: "alignRight",
|
|
42363
|
+
icon: "format_align_right",
|
|
42364
|
+
title: "Align Right"
|
|
42365
|
+
},
|
|
42366
|
+
alignJustify: {
|
|
42367
|
+
action: "alignJustify",
|
|
42368
|
+
icon: "format_align_justify",
|
|
42369
|
+
title: "Justify"
|
|
42370
|
+
},
|
|
42371
|
+
link: {
|
|
42372
|
+
action: "link",
|
|
42373
|
+
icon: "insert_link",
|
|
42374
|
+
title: "Insert Link"
|
|
42375
|
+
},
|
|
42376
|
+
insertImage: {
|
|
42377
|
+
action: "insertImage",
|
|
42378
|
+
icon: "insert_photo",
|
|
42379
|
+
title: "Insert Image"
|
|
42380
|
+
},
|
|
42381
|
+
unlink: {
|
|
42382
|
+
action: "unlink",
|
|
42383
|
+
icon: "link_off",
|
|
42384
|
+
title: "Remove Link"
|
|
42385
|
+
},
|
|
42386
|
+
undo: {
|
|
42387
|
+
action: "undo",
|
|
42388
|
+
icon: "undo",
|
|
42389
|
+
title: "Undo"
|
|
42390
|
+
},
|
|
42391
|
+
redo: {
|
|
42392
|
+
action: "redo",
|
|
42393
|
+
icon: "redo",
|
|
42394
|
+
title: "Redo"
|
|
42395
|
+
},
|
|
42396
|
+
clear: {
|
|
42397
|
+
action: "clear",
|
|
42398
|
+
icon: "format_clear",
|
|
42399
|
+
title: "Clear Format"
|
|
42400
|
+
},
|
|
42401
|
+
divider: {
|
|
42402
|
+
action: "divider"
|
|
42403
|
+
}
|
|
42404
|
+
};
|
|
42405
|
+
const DEFAULT_TOOLBAR = ["paragraph", "heading1", "heading2", "divider", "bold", "italic", "underline", "strikeThrough", "divider", "unorderedList", "orderedList", "blockquote", "divider", "alignLeft", "alignCenter", "alignRight", "alignJustify", "divider", "link", "insertImage", "unlink", "divider", "undo", "redo", "clear"];
|
|
42406
|
+
const ALIGNABLE_TAGS = ["P", "DIV", "H1", "H2", "H3", "BLOCKQUOTE", "LI", "PRE"];
|
|
42407
|
+
const SAFE_PROTOCOLS = ["http://", "https://", "mailto:", "tel:"];
|
|
42408
|
+
const SAFE_IMAGE_PROTOCOLS = ["http://", "https://", "data:image/", "blob:", "/"];
|
|
42409
|
+
const IMAGE_MIN_WIDTH = 40;
|
|
42410
|
+
const IMAGE_RESIZE_HANDLE_GAP = 16;
|
|
42411
|
+
const ALLOWED_TAGS = ["A", "B", "BLOCKQUOTE", "BR", "CODE", "DIV", "EM", "H1", "H2", "H3", "I", "IMG", "LI", "OL", "P", "PRE", "S", "SPAN", "STRIKE", "STRONG", "U", "UL"];
|
|
42412
|
+
/* harmony default export */ var FormWysiwygvue_type_script_lang_js = ({
|
|
42413
|
+
components: {
|
|
42414
|
+
BaseIcon: BaseIcon
|
|
42415
|
+
},
|
|
42416
|
+
props: {
|
|
42417
|
+
modelValue: {
|
|
42418
|
+
type: [String, Number],
|
|
42419
|
+
default: ""
|
|
42420
|
+
},
|
|
42421
|
+
placeholder: {
|
|
42422
|
+
type: String,
|
|
42423
|
+
default: "Write your content here"
|
|
42424
|
+
},
|
|
42425
|
+
message: {
|
|
42426
|
+
type: String,
|
|
42427
|
+
default: ""
|
|
42428
|
+
},
|
|
42429
|
+
error: {
|
|
42430
|
+
type: Boolean,
|
|
42431
|
+
default: false
|
|
42432
|
+
},
|
|
42433
|
+
disabled: {
|
|
42434
|
+
type: Boolean,
|
|
42435
|
+
default: false
|
|
42436
|
+
},
|
|
42437
|
+
readonly: {
|
|
42438
|
+
type: Boolean,
|
|
42439
|
+
default: false
|
|
42440
|
+
},
|
|
42441
|
+
labelPosition: {
|
|
42442
|
+
type: String,
|
|
42443
|
+
default: "top",
|
|
42444
|
+
validator(value) {
|
|
42445
|
+
return ["left", "top"].includes(value);
|
|
42446
|
+
}
|
|
42447
|
+
},
|
|
42448
|
+
minHeight: {
|
|
42449
|
+
type: [Number, String],
|
|
42450
|
+
default: 180
|
|
42451
|
+
},
|
|
42452
|
+
maxHeight: {
|
|
42453
|
+
type: [Number, String],
|
|
42454
|
+
default: ""
|
|
42455
|
+
},
|
|
42456
|
+
toolbar: {
|
|
42457
|
+
type: Array,
|
|
42458
|
+
default: () => []
|
|
42459
|
+
},
|
|
42460
|
+
showToolbar: {
|
|
42461
|
+
type: Boolean,
|
|
42462
|
+
default: true
|
|
42463
|
+
},
|
|
42464
|
+
sanitizeOnPaste: {
|
|
42465
|
+
type: Boolean,
|
|
42466
|
+
default: true
|
|
42467
|
+
},
|
|
42468
|
+
sanitizeOnBlur: {
|
|
42469
|
+
type: Boolean,
|
|
42470
|
+
default: true
|
|
42471
|
+
}
|
|
42472
|
+
},
|
|
42473
|
+
emits: ["update:modelValue", "update:text", "input", "change", "focus", "blur"],
|
|
42474
|
+
data() {
|
|
42475
|
+
return {
|
|
42476
|
+
isEmpty: true,
|
|
42477
|
+
isFocused: false,
|
|
42478
|
+
isEmitting: false,
|
|
42479
|
+
savedRange: null,
|
|
42480
|
+
imageResize: {
|
|
42481
|
+
active: false,
|
|
42482
|
+
target: null,
|
|
42483
|
+
startX: 0,
|
|
42484
|
+
startWidth: 0,
|
|
42485
|
+
maxWidth: 0
|
|
42486
|
+
},
|
|
42487
|
+
toolbarState: {
|
|
42488
|
+
bold: false,
|
|
42489
|
+
italic: false,
|
|
42490
|
+
underline: false,
|
|
42491
|
+
strikeThrough: false,
|
|
42492
|
+
unorderedList: false,
|
|
42493
|
+
orderedList: false,
|
|
42494
|
+
blockquote: false,
|
|
42495
|
+
align: "justifyLeft",
|
|
42496
|
+
formatBlock: "P"
|
|
42497
|
+
}
|
|
42498
|
+
};
|
|
42499
|
+
},
|
|
42500
|
+
computed: {
|
|
42501
|
+
resolvedToolbar() {
|
|
42502
|
+
const source = this.toolbar.length ? this.toolbar : DEFAULT_TOOLBAR;
|
|
42503
|
+
return source.map(item => {
|
|
42504
|
+
if (typeof item === "string") {
|
|
42505
|
+
return TOOLBAR_ITEMS[item] || null;
|
|
42506
|
+
}
|
|
42507
|
+
if (!item || !item.action) {
|
|
42508
|
+
return null;
|
|
42509
|
+
}
|
|
42510
|
+
return item;
|
|
42511
|
+
}).filter(item => item);
|
|
42512
|
+
},
|
|
42513
|
+
editorStyle() {
|
|
42514
|
+
const maxHeight = this.maxHeight ? this.normalizeSize(this.maxHeight) : "none";
|
|
42515
|
+
return {
|
|
42516
|
+
minHeight: this.normalizeSize(this.minHeight),
|
|
42517
|
+
maxHeight: maxHeight
|
|
42518
|
+
};
|
|
42519
|
+
},
|
|
42520
|
+
isEditable() {
|
|
42521
|
+
return !this.disabled && !this.readonly;
|
|
42522
|
+
}
|
|
42523
|
+
},
|
|
42524
|
+
watch: {
|
|
42525
|
+
modelValue(newValue) {
|
|
42526
|
+
if (this.isEmitting) {
|
|
42527
|
+
return;
|
|
42528
|
+
}
|
|
42529
|
+
this.setEditorValue(newValue);
|
|
42530
|
+
}
|
|
42531
|
+
},
|
|
42532
|
+
mounted() {
|
|
42533
|
+
this.setEditorValue(this.modelValue);
|
|
42534
|
+
this.refreshToolbarState();
|
|
42535
|
+
document.addEventListener("selectionchange", this.handleSelectionChange);
|
|
42536
|
+
},
|
|
42537
|
+
beforeUnmount() {
|
|
42538
|
+
document.removeEventListener("selectionchange", this.handleSelectionChange);
|
|
42539
|
+
this.stopImageResize();
|
|
42540
|
+
},
|
|
42541
|
+
methods: {
|
|
42542
|
+
normalizeSize(value) {
|
|
42543
|
+
return Number.isFinite(Number(value)) ? `${Number(value)}px` : String(value);
|
|
42544
|
+
},
|
|
42545
|
+
setEditorValue(value) {
|
|
42546
|
+
const editor = this.$refs.editorRef;
|
|
42547
|
+
if (!editor) {
|
|
42548
|
+
return;
|
|
42549
|
+
}
|
|
42550
|
+
let nextValue = value == null ? "" : String(value);
|
|
42551
|
+
if (this.sanitizeOnBlur && nextValue) {
|
|
42552
|
+
nextValue = this.sanitizeHtml(nextValue);
|
|
42553
|
+
}
|
|
42554
|
+
if (this.isHtmlEmpty(nextValue)) {
|
|
42555
|
+
nextValue = "";
|
|
42556
|
+
}
|
|
42557
|
+
if (editor.innerHTML !== nextValue) {
|
|
42558
|
+
editor.innerHTML = nextValue;
|
|
42559
|
+
}
|
|
42560
|
+
this.updateEmptyState();
|
|
42561
|
+
},
|
|
42562
|
+
handleInput() {
|
|
42563
|
+
this.emitModelValue();
|
|
42564
|
+
this.refreshToolbarState();
|
|
42565
|
+
},
|
|
42566
|
+
handleFocus() {
|
|
42567
|
+
this.isFocused = true;
|
|
42568
|
+
this.$emit("focus");
|
|
42569
|
+
this.refreshToolbarState();
|
|
42570
|
+
},
|
|
42571
|
+
handleBlur() {
|
|
42572
|
+
this.isFocused = false;
|
|
42573
|
+
if (this.sanitizeOnBlur) {
|
|
42574
|
+
const editor = this.$refs.editorRef;
|
|
42575
|
+
const sanitizedValue = this.sanitizeHtml(editor.innerHTML);
|
|
42576
|
+
if (editor.innerHTML !== sanitizedValue) {
|
|
42577
|
+
editor.innerHTML = sanitizedValue;
|
|
42578
|
+
}
|
|
42579
|
+
}
|
|
42580
|
+
const htmlValue = this.emitModelValue();
|
|
42581
|
+
this.$emit("change", htmlValue);
|
|
42582
|
+
this.$emit("blur", htmlValue);
|
|
42583
|
+
this.refreshToolbarState();
|
|
42584
|
+
},
|
|
42585
|
+
handlePaste(event) {
|
|
42586
|
+
if (!this.sanitizeOnPaste || !this.isEditable) {
|
|
42587
|
+
return;
|
|
42588
|
+
}
|
|
42589
|
+
event.preventDefault();
|
|
42590
|
+
const clipboardData = event.clipboardData || window.clipboardData;
|
|
42591
|
+
const htmlPayload = clipboardData.getData("text/html");
|
|
42592
|
+
const textPayload = clipboardData.getData("text/plain");
|
|
42593
|
+
let contentToInsert = "";
|
|
42594
|
+
if (htmlPayload) {
|
|
42595
|
+
contentToInsert = this.sanitizeHtml(htmlPayload);
|
|
42596
|
+
} else {
|
|
42597
|
+
contentToInsert = this.escapeHtml(textPayload).replace(/\n/g, "<br>");
|
|
42598
|
+
}
|
|
42599
|
+
this.focusEditor();
|
|
42600
|
+
document.execCommand("insertHTML", false, contentToInsert);
|
|
42601
|
+
this.handleInput();
|
|
42602
|
+
},
|
|
42603
|
+
handleSelectionChange() {
|
|
42604
|
+
if (this.isFocused) {
|
|
42605
|
+
this.refreshToolbarState();
|
|
42606
|
+
}
|
|
42607
|
+
},
|
|
42608
|
+
handleEditorMouseDown(event) {
|
|
42609
|
+
if (!this.isEditable) {
|
|
42610
|
+
return;
|
|
42611
|
+
}
|
|
42612
|
+
const targetImage = event.target;
|
|
42613
|
+
if (!targetImage || targetImage.tagName !== "IMG") {
|
|
42614
|
+
return;
|
|
42615
|
+
}
|
|
42616
|
+
if (!this.isOnImageResizeHandle(event, targetImage)) {
|
|
42617
|
+
return;
|
|
42618
|
+
}
|
|
42619
|
+
event.preventDefault();
|
|
42620
|
+
this.startImageResize(event, targetImage);
|
|
42621
|
+
},
|
|
42622
|
+
handleEditorMouseMove(event) {
|
|
42623
|
+
if (this.imageResize.active) {
|
|
42624
|
+
return;
|
|
42625
|
+
}
|
|
42626
|
+
const editor = this.$refs.editorRef;
|
|
42627
|
+
if (!editor) {
|
|
42628
|
+
return;
|
|
42629
|
+
}
|
|
42630
|
+
const targetImage = event.target;
|
|
42631
|
+
if (!targetImage || targetImage.tagName !== "IMG") {
|
|
42632
|
+
editor.style.cursor = "";
|
|
42633
|
+
return;
|
|
42634
|
+
}
|
|
42635
|
+
editor.style.cursor = this.isOnImageResizeHandle(event, targetImage) ? "nwse-resize" : "";
|
|
42636
|
+
},
|
|
42637
|
+
handleEditorMouseLeave() {
|
|
42638
|
+
if (this.imageResize.active) {
|
|
42639
|
+
return;
|
|
42640
|
+
}
|
|
42641
|
+
const editor = this.$refs.editorRef;
|
|
42642
|
+
if (editor) {
|
|
42643
|
+
editor.style.cursor = "";
|
|
42644
|
+
}
|
|
42645
|
+
},
|
|
42646
|
+
startImageResize(event, imageNode) {
|
|
42647
|
+
this.imageResize = {
|
|
42648
|
+
active: true,
|
|
42649
|
+
target: imageNode,
|
|
42650
|
+
startX: event.clientX,
|
|
42651
|
+
startWidth: this.getImageWidth(imageNode),
|
|
42652
|
+
maxWidth: this.getImageResizeMaxWidth()
|
|
42653
|
+
};
|
|
42654
|
+
imageNode.classList.add("resizing-image");
|
|
42655
|
+
document.body.style.userSelect = "none";
|
|
42656
|
+
window.addEventListener("mousemove", this.onImageResizeMove);
|
|
42657
|
+
window.addEventListener("mouseup", this.stopImageResize);
|
|
42658
|
+
},
|
|
42659
|
+
onImageResizeMove(event) {
|
|
42660
|
+
if (!this.imageResize.active || !this.imageResize.target) {
|
|
42661
|
+
return;
|
|
42662
|
+
}
|
|
42663
|
+
const deltaX = event.clientX - this.imageResize.startX;
|
|
42664
|
+
const nextWidth = Math.max(IMAGE_MIN_WIDTH, Math.min(this.imageResize.startWidth + deltaX, this.imageResize.maxWidth));
|
|
42665
|
+
this.imageResize.target.style.width = `${nextWidth}px`;
|
|
42666
|
+
this.imageResize.target.setAttribute("width", `${Math.round(nextWidth)}`);
|
|
42667
|
+
this.imageResize.target.style.height = "auto";
|
|
42668
|
+
},
|
|
42669
|
+
stopImageResize() {
|
|
42670
|
+
if (!this.imageResize.active) {
|
|
42671
|
+
return;
|
|
42672
|
+
}
|
|
42673
|
+
const resizedTarget = this.imageResize.target;
|
|
42674
|
+
if (resizedTarget) {
|
|
42675
|
+
resizedTarget.classList.remove("resizing-image");
|
|
42676
|
+
}
|
|
42677
|
+
this.imageResize = {
|
|
42678
|
+
active: false,
|
|
42679
|
+
target: null,
|
|
42680
|
+
startX: 0,
|
|
42681
|
+
startWidth: 0,
|
|
42682
|
+
maxWidth: 0
|
|
42683
|
+
};
|
|
42684
|
+
document.body.style.userSelect = "";
|
|
42685
|
+
window.removeEventListener("mousemove", this.onImageResizeMove);
|
|
42686
|
+
window.removeEventListener("mouseup", this.stopImageResize);
|
|
42687
|
+
const editor = this.$refs.editorRef;
|
|
42688
|
+
if (editor) {
|
|
42689
|
+
editor.style.cursor = "";
|
|
42690
|
+
}
|
|
42691
|
+
this.emitModelValue();
|
|
42692
|
+
},
|
|
42693
|
+
getImageWidth(imageNode) {
|
|
42694
|
+
const widthFromAttribute = Number(imageNode.getAttribute("width"));
|
|
42695
|
+
if (Number.isFinite(widthFromAttribute) && widthFromAttribute > 0) {
|
|
42696
|
+
return widthFromAttribute;
|
|
42697
|
+
}
|
|
42698
|
+
const rect = imageNode.getBoundingClientRect();
|
|
42699
|
+
if (rect.width > 0) {
|
|
42700
|
+
return rect.width;
|
|
42701
|
+
}
|
|
42702
|
+
return IMAGE_MIN_WIDTH;
|
|
42703
|
+
},
|
|
42704
|
+
getImageResizeMaxWidth() {
|
|
42705
|
+
const editor = this.$refs.editorRef;
|
|
42706
|
+
if (!editor) {
|
|
42707
|
+
return 1200;
|
|
42708
|
+
}
|
|
42709
|
+
const editorWidth = editor.clientWidth || 1200;
|
|
42710
|
+
return Math.max(editorWidth, IMAGE_MIN_WIDTH);
|
|
42711
|
+
},
|
|
42712
|
+
isOnImageResizeHandle(event, imageNode) {
|
|
42713
|
+
const imageRect = imageNode.getBoundingClientRect();
|
|
42714
|
+
const isInsideX = event.clientX >= imageRect.right - IMAGE_RESIZE_HANDLE_GAP;
|
|
42715
|
+
const isInsideY = event.clientY >= imageRect.bottom - IMAGE_RESIZE_HANDLE_GAP;
|
|
42716
|
+
return isInsideX && isInsideY;
|
|
42717
|
+
},
|
|
42718
|
+
emitModelValue() {
|
|
42719
|
+
const editor = this.$refs.editorRef;
|
|
42720
|
+
if (!editor) {
|
|
42721
|
+
return "";
|
|
42722
|
+
}
|
|
42723
|
+
let htmlValue = editor.innerHTML;
|
|
42724
|
+
if (this.isHtmlEmpty(htmlValue)) {
|
|
42725
|
+
htmlValue = "";
|
|
42726
|
+
if (editor.innerHTML !== "") {
|
|
42727
|
+
editor.innerHTML = "";
|
|
42728
|
+
}
|
|
42729
|
+
}
|
|
42730
|
+
this.updateEmptyState();
|
|
42731
|
+
this.isEmitting = true;
|
|
42732
|
+
this.$emit("update:modelValue", htmlValue);
|
|
42733
|
+
this.$emit("input", htmlValue);
|
|
42734
|
+
this.$emit("update:text", this.getPlainText());
|
|
42735
|
+
this.$nextTick(() => {
|
|
42736
|
+
this.isEmitting = false;
|
|
42737
|
+
});
|
|
42738
|
+
return htmlValue;
|
|
42739
|
+
},
|
|
42740
|
+
refreshToolbarState() {
|
|
42741
|
+
if (!this.selectionInsideEditor()) {
|
|
42742
|
+
this.toolbarState = {
|
|
42743
|
+
bold: false,
|
|
42744
|
+
italic: false,
|
|
42745
|
+
underline: false,
|
|
42746
|
+
strikeThrough: false,
|
|
42747
|
+
unorderedList: false,
|
|
42748
|
+
orderedList: false,
|
|
42749
|
+
blockquote: false,
|
|
42750
|
+
align: "justifyLeft",
|
|
42751
|
+
formatBlock: "P"
|
|
42752
|
+
};
|
|
42753
|
+
return;
|
|
42754
|
+
}
|
|
42755
|
+
const activeAlign = ["justifyLeft", "justifyCenter", "justifyRight", "justifyFull"].find(command => document.queryCommandState(command));
|
|
42756
|
+
const blockValue = (document.queryCommandValue("formatBlock") || "").replace(/[<>]/g, "").toUpperCase();
|
|
42757
|
+
this.toolbarState = {
|
|
42758
|
+
bold: document.queryCommandState("bold"),
|
|
42759
|
+
italic: document.queryCommandState("italic"),
|
|
42760
|
+
underline: document.queryCommandState("underline"),
|
|
42761
|
+
strikeThrough: document.queryCommandState("strikeThrough"),
|
|
42762
|
+
unorderedList: document.queryCommandState("insertUnorderedList"),
|
|
42763
|
+
orderedList: document.queryCommandState("insertOrderedList"),
|
|
42764
|
+
blockquote: blockValue === "BLOCKQUOTE",
|
|
42765
|
+
align: activeAlign || "justifyLeft",
|
|
42766
|
+
formatBlock: blockValue || "P"
|
|
42767
|
+
};
|
|
42768
|
+
},
|
|
42769
|
+
selectionInsideEditor() {
|
|
42770
|
+
const editor = this.$refs.editorRef;
|
|
42771
|
+
const selection = window.getSelection();
|
|
42772
|
+
if (!editor || !selection || !selection.rangeCount) {
|
|
42773
|
+
return false;
|
|
42774
|
+
}
|
|
42775
|
+
const range = selection.getRangeAt(0);
|
|
42776
|
+
return editor.contains(range.commonAncestorContainer);
|
|
42777
|
+
},
|
|
42778
|
+
focusEditor() {
|
|
42779
|
+
const editor = this.$refs.editorRef;
|
|
42780
|
+
if (!editor) {
|
|
42781
|
+
return;
|
|
42782
|
+
}
|
|
42783
|
+
editor.focus();
|
|
42784
|
+
if (!this.selectionInsideEditor()) {
|
|
42785
|
+
const range = document.createRange();
|
|
42786
|
+
range.selectNodeContents(editor);
|
|
42787
|
+
range.collapse(false);
|
|
42788
|
+
const selection = window.getSelection();
|
|
42789
|
+
selection.removeAllRanges();
|
|
42790
|
+
selection.addRange(range);
|
|
42791
|
+
}
|
|
42792
|
+
},
|
|
42793
|
+
handleToolbarAction(item) {
|
|
42794
|
+
if (this.isActionDisabled(item)) {
|
|
42795
|
+
return;
|
|
42796
|
+
}
|
|
42797
|
+
this.focusEditor();
|
|
42798
|
+
this.saveRange();
|
|
42799
|
+
switch (item.action) {
|
|
42800
|
+
case "paragraph":
|
|
42801
|
+
this.executeCommand("formatBlock", "P");
|
|
42802
|
+
break;
|
|
42803
|
+
case "heading1":
|
|
42804
|
+
this.executeCommand("formatBlock", "H1");
|
|
42805
|
+
break;
|
|
42806
|
+
case "heading2":
|
|
42807
|
+
this.executeCommand("formatBlock", "H2");
|
|
42808
|
+
break;
|
|
42809
|
+
case "bold":
|
|
42810
|
+
this.executeCommand("bold");
|
|
42811
|
+
break;
|
|
42812
|
+
case "italic":
|
|
42813
|
+
this.executeCommand("italic");
|
|
42814
|
+
break;
|
|
42815
|
+
case "underline":
|
|
42816
|
+
this.executeCommand("underline");
|
|
42817
|
+
break;
|
|
42818
|
+
case "strikeThrough":
|
|
42819
|
+
this.executeCommand("strikeThrough");
|
|
42820
|
+
break;
|
|
42821
|
+
case "unorderedList":
|
|
42822
|
+
this.executeCommand("insertUnorderedList");
|
|
42823
|
+
break;
|
|
42824
|
+
case "orderedList":
|
|
42825
|
+
this.executeCommand("insertOrderedList");
|
|
42826
|
+
break;
|
|
42827
|
+
case "blockquote":
|
|
42828
|
+
if (this.toolbarState.blockquote) {
|
|
42829
|
+
this.executeCommand("formatBlock", "P");
|
|
42830
|
+
} else {
|
|
42831
|
+
this.executeCommand("formatBlock", "BLOCKQUOTE");
|
|
42832
|
+
}
|
|
42833
|
+
break;
|
|
42834
|
+
case "alignLeft":
|
|
42835
|
+
this.executeCommand("justifyLeft");
|
|
42836
|
+
break;
|
|
42837
|
+
case "alignCenter":
|
|
42838
|
+
this.executeCommand("justifyCenter");
|
|
42839
|
+
break;
|
|
42840
|
+
case "alignRight":
|
|
42841
|
+
this.executeCommand("justifyRight");
|
|
42842
|
+
break;
|
|
42843
|
+
case "alignJustify":
|
|
42844
|
+
this.executeCommand("justifyFull");
|
|
42845
|
+
break;
|
|
42846
|
+
case "link":
|
|
42847
|
+
this.createLink();
|
|
42848
|
+
break;
|
|
42849
|
+
case "insertImage":
|
|
42850
|
+
this.triggerImagePicker();
|
|
42851
|
+
break;
|
|
42852
|
+
case "unlink":
|
|
42853
|
+
this.executeCommand("unlink");
|
|
42854
|
+
break;
|
|
42855
|
+
case "undo":
|
|
42856
|
+
this.executeCommand("undo");
|
|
42857
|
+
break;
|
|
42858
|
+
case "redo":
|
|
42859
|
+
this.executeCommand("redo");
|
|
42860
|
+
break;
|
|
42861
|
+
case "clear":
|
|
42862
|
+
this.executeCommand("removeFormat");
|
|
42863
|
+
this.executeCommand("unlink");
|
|
42864
|
+
this.executeCommand("formatBlock", "P");
|
|
42865
|
+
break;
|
|
42866
|
+
default:
|
|
42867
|
+
break;
|
|
42868
|
+
}
|
|
42869
|
+
},
|
|
42870
|
+
executeCommand(command, value = null) {
|
|
42871
|
+
this.focusEditor();
|
|
42872
|
+
this.restoreRange();
|
|
42873
|
+
document.execCommand(command, false, value);
|
|
42874
|
+
this.handleInput();
|
|
42875
|
+
},
|
|
42876
|
+
triggerImagePicker() {
|
|
42877
|
+
const imageInput = this.$refs.imageInputRef;
|
|
42878
|
+
if (!imageInput) {
|
|
42879
|
+
return;
|
|
42880
|
+
}
|
|
42881
|
+
imageInput.value = "";
|
|
42882
|
+
imageInput.click();
|
|
42883
|
+
},
|
|
42884
|
+
handleImageSelected(event) {
|
|
42885
|
+
var _event$target;
|
|
42886
|
+
const file = (_event$target = event.target) === null || _event$target === void 0 || (_event$target = _event$target.files) === null || _event$target === void 0 ? void 0 : _event$target[0];
|
|
42887
|
+
if (!file || !String(file.type).startsWith("image/")) {
|
|
42888
|
+
return;
|
|
42889
|
+
}
|
|
42890
|
+
const fileReader = new FileReader();
|
|
42891
|
+
fileReader.onload = () => {
|
|
42892
|
+
this.insertImage(String(fileReader.result || ""));
|
|
42893
|
+
};
|
|
42894
|
+
fileReader.readAsDataURL(file);
|
|
42895
|
+
},
|
|
42896
|
+
insertImage(rawImageSrc) {
|
|
42897
|
+
const imageSrc = this.normalizeImageSrc(rawImageSrc);
|
|
42898
|
+
if (!this.isSafeImageSrc(imageSrc)) {
|
|
42899
|
+
return;
|
|
42900
|
+
}
|
|
42901
|
+
this.focusEditor();
|
|
42902
|
+
this.restoreRange();
|
|
42903
|
+
const safeSrc = this.escapeHtml(imageSrc);
|
|
42904
|
+
document.execCommand("insertHTML", false, `<img src="${safeSrc}" alt="image">`);
|
|
42905
|
+
this.handleInput();
|
|
42906
|
+
},
|
|
42907
|
+
createLink() {
|
|
42908
|
+
this.restoreRange();
|
|
42909
|
+
const selection = window.getSelection();
|
|
42910
|
+
const selectedText = selection ? selection.toString() : "";
|
|
42911
|
+
const defaultUrl = selectedText && this.isSafeUrl(selectedText) ? selectedText : "https://";
|
|
42912
|
+
const rawUrl = window.prompt("Input URL", defaultUrl);
|
|
42913
|
+
if (!rawUrl) {
|
|
42914
|
+
return;
|
|
42915
|
+
}
|
|
42916
|
+
const normalizedUrl = this.normalizeUrl(rawUrl);
|
|
42917
|
+
if (!this.isSafeUrl(normalizedUrl)) {
|
|
42918
|
+
return;
|
|
42919
|
+
}
|
|
42920
|
+
this.focusEditor();
|
|
42921
|
+
this.restoreRange();
|
|
42922
|
+
const selectedRange = window.getSelection();
|
|
42923
|
+
if (selectedRange && selectedRange.toString()) {
|
|
42924
|
+
document.execCommand("createLink", false, normalizedUrl);
|
|
42925
|
+
} else {
|
|
42926
|
+
const safeUrl = this.escapeHtml(normalizedUrl);
|
|
42927
|
+
document.execCommand("insertHTML", false, `<a href="${safeUrl}" target="_blank" rel="noopener noreferrer">${safeUrl}</a>`);
|
|
42928
|
+
}
|
|
42929
|
+
this.handleInput();
|
|
42930
|
+
},
|
|
42931
|
+
normalizeUrl(rawUrl) {
|
|
42932
|
+
const trimmedUrl = String(rawUrl).trim();
|
|
42933
|
+
if (!trimmedUrl) {
|
|
42934
|
+
return "";
|
|
42935
|
+
}
|
|
42936
|
+
if (SAFE_PROTOCOLS.some(protocol => trimmedUrl.toLowerCase().startsWith(protocol))) {
|
|
42937
|
+
return trimmedUrl;
|
|
42938
|
+
}
|
|
42939
|
+
return `https://${trimmedUrl}`;
|
|
42940
|
+
},
|
|
42941
|
+
isSafeUrl(url) {
|
|
42942
|
+
if (!url) {
|
|
42943
|
+
return false;
|
|
42944
|
+
}
|
|
42945
|
+
return SAFE_PROTOCOLS.some(protocol => url.toLowerCase().startsWith(protocol));
|
|
42946
|
+
},
|
|
42947
|
+
normalizeImageSrc(rawSrc) {
|
|
42948
|
+
const cleanedSrc = String(rawSrc || "").trim();
|
|
42949
|
+
if (!cleanedSrc) {
|
|
42950
|
+
return "";
|
|
42951
|
+
}
|
|
42952
|
+
const normalizedSrc = cleanedSrc.toLowerCase();
|
|
42953
|
+
if (SAFE_IMAGE_PROTOCOLS.some(protocol => normalizedSrc.startsWith(protocol))) {
|
|
42954
|
+
return cleanedSrc;
|
|
42955
|
+
}
|
|
42956
|
+
return `https://${cleanedSrc}`;
|
|
42957
|
+
},
|
|
42958
|
+
isSafeImageSrc(src) {
|
|
42959
|
+
if (!src) {
|
|
42960
|
+
return false;
|
|
42961
|
+
}
|
|
42962
|
+
const normalizedSrc = src.toLowerCase();
|
|
42963
|
+
return SAFE_IMAGE_PROTOCOLS.some(protocol => normalizedSrc.startsWith(protocol));
|
|
42964
|
+
},
|
|
42965
|
+
saveRange() {
|
|
42966
|
+
const selection = window.getSelection();
|
|
42967
|
+
if (selection && selection.rangeCount) {
|
|
42968
|
+
this.savedRange = selection.getRangeAt(0).cloneRange();
|
|
42969
|
+
}
|
|
42970
|
+
},
|
|
42971
|
+
restoreRange() {
|
|
42972
|
+
if (!this.savedRange) {
|
|
42973
|
+
return;
|
|
42974
|
+
}
|
|
42975
|
+
const selection = window.getSelection();
|
|
42976
|
+
selection.removeAllRanges();
|
|
42977
|
+
selection.addRange(this.savedRange);
|
|
42978
|
+
},
|
|
42979
|
+
sanitizeHtml(htmlValue) {
|
|
42980
|
+
const source = document.createElement("div");
|
|
42981
|
+
source.innerHTML = htmlValue || "";
|
|
42982
|
+
const target = document.createElement("div");
|
|
42983
|
+
Array.from(source.childNodes).forEach(node => {
|
|
42984
|
+
const sanitizedNode = this.createSanitizedNode(node, document);
|
|
42985
|
+
if (sanitizedNode) {
|
|
42986
|
+
target.appendChild(sanitizedNode);
|
|
42987
|
+
}
|
|
42988
|
+
});
|
|
42989
|
+
return target.innerHTML;
|
|
42990
|
+
},
|
|
42991
|
+
createSanitizedNode(node, doc) {
|
|
42992
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
42993
|
+
return doc.createTextNode(node.textContent || "");
|
|
42994
|
+
}
|
|
42995
|
+
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
42996
|
+
return null;
|
|
42997
|
+
}
|
|
42998
|
+
const tagName = node.tagName.toUpperCase();
|
|
42999
|
+
if (!ALLOWED_TAGS.includes(tagName)) {
|
|
43000
|
+
const fragment = doc.createDocumentFragment();
|
|
43001
|
+
Array.from(node.childNodes).forEach(child => {
|
|
43002
|
+
const childNode = this.createSanitizedNode(child, doc);
|
|
43003
|
+
if (childNode) {
|
|
43004
|
+
fragment.appendChild(childNode);
|
|
43005
|
+
}
|
|
43006
|
+
});
|
|
43007
|
+
return fragment;
|
|
43008
|
+
}
|
|
43009
|
+
const element = doc.createElement(tagName.toLowerCase());
|
|
43010
|
+
if (tagName === "A") {
|
|
43011
|
+
const href = this.normalizeUrl(node.getAttribute("href") || "");
|
|
43012
|
+
if (this.isSafeUrl(href)) {
|
|
43013
|
+
element.setAttribute("href", href);
|
|
43014
|
+
element.setAttribute("target", "_blank");
|
|
43015
|
+
element.setAttribute("rel", "noopener noreferrer");
|
|
43016
|
+
}
|
|
43017
|
+
}
|
|
43018
|
+
if (tagName === "IMG") {
|
|
43019
|
+
const imageSrc = this.normalizeImageSrc(node.getAttribute("src") || "");
|
|
43020
|
+
if (!this.isSafeImageSrc(imageSrc)) {
|
|
43021
|
+
return null;
|
|
43022
|
+
}
|
|
43023
|
+
element.setAttribute("src", imageSrc);
|
|
43024
|
+
element.setAttribute("alt", node.getAttribute("alt") || "image");
|
|
43025
|
+
const imageWidth = Number(node.getAttribute("width"));
|
|
43026
|
+
if (Number.isFinite(imageWidth) && imageWidth > 0) {
|
|
43027
|
+
element.setAttribute("width", `${Math.max(IMAGE_MIN_WIDTH, Math.round(imageWidth))}`);
|
|
43028
|
+
}
|
|
43029
|
+
}
|
|
43030
|
+
const textAlign = this.extractAllowedTextAlign(node.getAttribute("style"));
|
|
43031
|
+
if (textAlign && ALIGNABLE_TAGS.includes(tagName)) {
|
|
43032
|
+
element.setAttribute("style", `text-align:${textAlign};`);
|
|
43033
|
+
}
|
|
43034
|
+
Array.from(node.childNodes).forEach(child => {
|
|
43035
|
+
const childNode = this.createSanitizedNode(child, doc);
|
|
43036
|
+
if (childNode) {
|
|
43037
|
+
element.appendChild(childNode);
|
|
43038
|
+
}
|
|
43039
|
+
});
|
|
43040
|
+
return element;
|
|
43041
|
+
},
|
|
43042
|
+
extractAllowedTextAlign(styleValue) {
|
|
43043
|
+
if (!styleValue) {
|
|
43044
|
+
return "";
|
|
43045
|
+
}
|
|
43046
|
+
const rules = styleValue.split(";").map(style => style.trim());
|
|
43047
|
+
const textAlignRule = rules.find(style => style.toLowerCase().startsWith("text-align"));
|
|
43048
|
+
if (!textAlignRule) {
|
|
43049
|
+
return "";
|
|
43050
|
+
}
|
|
43051
|
+
const parsed = textAlignRule.split(":");
|
|
43052
|
+
if (parsed.length < 2) {
|
|
43053
|
+
return "";
|
|
43054
|
+
}
|
|
43055
|
+
const alignValue = parsed[1].trim().toLowerCase();
|
|
43056
|
+
return ["left", "center", "right", "justify"].includes(alignValue) ? alignValue : "";
|
|
43057
|
+
},
|
|
43058
|
+
isActionActive(item) {
|
|
43059
|
+
switch (item.action) {
|
|
43060
|
+
case "paragraph":
|
|
43061
|
+
return this.toolbarState.formatBlock === "P" || this.toolbarState.formatBlock === "DIV";
|
|
43062
|
+
case "heading1":
|
|
43063
|
+
return this.toolbarState.formatBlock === "H1";
|
|
43064
|
+
case "heading2":
|
|
43065
|
+
return this.toolbarState.formatBlock === "H2";
|
|
43066
|
+
case "bold":
|
|
43067
|
+
return this.toolbarState.bold;
|
|
43068
|
+
case "italic":
|
|
43069
|
+
return this.toolbarState.italic;
|
|
43070
|
+
case "underline":
|
|
43071
|
+
return this.toolbarState.underline;
|
|
43072
|
+
case "strikeThrough":
|
|
43073
|
+
return this.toolbarState.strikeThrough;
|
|
43074
|
+
case "unorderedList":
|
|
43075
|
+
return this.toolbarState.unorderedList;
|
|
43076
|
+
case "orderedList":
|
|
43077
|
+
return this.toolbarState.orderedList;
|
|
43078
|
+
case "blockquote":
|
|
43079
|
+
return this.toolbarState.blockquote;
|
|
43080
|
+
case "alignLeft":
|
|
43081
|
+
return this.toolbarState.align === "justifyLeft";
|
|
43082
|
+
case "alignCenter":
|
|
43083
|
+
return this.toolbarState.align === "justifyCenter";
|
|
43084
|
+
case "alignRight":
|
|
43085
|
+
return this.toolbarState.align === "justifyRight";
|
|
43086
|
+
case "alignJustify":
|
|
43087
|
+
return this.toolbarState.align === "justifyFull";
|
|
43088
|
+
default:
|
|
43089
|
+
return false;
|
|
43090
|
+
}
|
|
43091
|
+
},
|
|
43092
|
+
isActionDisabled(item) {
|
|
43093
|
+
return item.action === "divider" || !this.isEditable;
|
|
43094
|
+
},
|
|
43095
|
+
updateEmptyState() {
|
|
43096
|
+
const editor = this.$refs.editorRef;
|
|
43097
|
+
if (!editor) {
|
|
43098
|
+
this.isEmpty = true;
|
|
43099
|
+
return;
|
|
43100
|
+
}
|
|
43101
|
+
this.isEmpty = this.isHtmlEmpty(editor.innerHTML);
|
|
43102
|
+
},
|
|
43103
|
+
isHtmlEmpty(htmlValue) {
|
|
43104
|
+
if (!htmlValue) {
|
|
43105
|
+
return true;
|
|
43106
|
+
}
|
|
43107
|
+
const cleaned = String(htmlValue).replace(/ /gi, "").replace(/<br\s*\/?>/gi, "").replace(/\s+/g, "");
|
|
43108
|
+
if (!cleaned) {
|
|
43109
|
+
return true;
|
|
43110
|
+
}
|
|
43111
|
+
const inspector = document.createElement("div");
|
|
43112
|
+
inspector.innerHTML = htmlValue;
|
|
43113
|
+
const textContent = (inspector.textContent || "").replace(/\u200B/g, "").trim();
|
|
43114
|
+
const hasImage = Boolean(inspector.querySelector("img"));
|
|
43115
|
+
if (hasImage) {
|
|
43116
|
+
return false;
|
|
43117
|
+
}
|
|
43118
|
+
return textContent.length === 0;
|
|
43119
|
+
},
|
|
43120
|
+
getPlainText() {
|
|
43121
|
+
const editor = this.$refs.editorRef;
|
|
43122
|
+
if (!editor) {
|
|
43123
|
+
return "";
|
|
43124
|
+
}
|
|
43125
|
+
return (editor.innerText || "").replace(/\u200B/g, "").trim();
|
|
43126
|
+
},
|
|
43127
|
+
escapeHtml(value) {
|
|
43128
|
+
return String(value || "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
43129
|
+
}
|
|
43130
|
+
}
|
|
43131
|
+
});
|
|
43132
|
+
// CONCATENATED MODULE: ./src/components/Form/FormWysiwyg.vue?vue&type=script&lang=js
|
|
43133
|
+
|
|
43134
|
+
// EXTERNAL MODULE: ./src/components/Form/FormWysiwyg.vue?vue&type=style&index=0&id=52b4ebd4&lang=scss
|
|
43135
|
+
var FormWysiwygvue_type_style_index_0_id_52b4ebd4_lang_scss = __webpack_require__("d831");
|
|
43136
|
+
|
|
43137
|
+
// CONCATENATED MODULE: ./src/components/Form/FormWysiwyg.vue
|
|
43138
|
+
|
|
43139
|
+
|
|
43140
|
+
|
|
43141
|
+
|
|
43142
|
+
|
|
43143
|
+
|
|
43144
|
+
|
|
43145
|
+
const FormWysiwyg_exports_ = /*#__PURE__*/exportHelper_default()(FormWysiwygvue_type_script_lang_js, [['render',FormWysiwygvue_type_template_id_52b4ebd4_render]])
|
|
43146
|
+
|
|
43147
|
+
/* harmony default export */ var FormWysiwyg = (FormWysiwyg_exports_);
|
|
42075
43148
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/ExpansionPanel/index.vue?vue&type=template&id=01544323
|
|
42076
43149
|
|
|
42077
43150
|
const ExpansionPanelvue_type_template_id_01544323_hoisted_1 = {
|
|
@@ -42281,6 +43354,7 @@ const AnimatedIconLogo_exports_ = AnimatedIconLogovue_type_script_setup_true_lan
|
|
|
42281
43354
|
|
|
42282
43355
|
|
|
42283
43356
|
|
|
43357
|
+
|
|
42284
43358
|
|
|
42285
43359
|
|
|
42286
43360
|
// CONCATENATED MODULE: ./src/install.js
|