update 2023-04-10

This commit is contained in:
2023-04-10 11:25:34 +07:00
parent 9e890303ba
commit b64325d3c6
12 changed files with 1703 additions and 592 deletions
+24 -44
View File
@@ -4,25 +4,13 @@
Desc. : CSS Default Configuration Desc. : CSS Default Configuration
Created By : Siau Pheng ([email protected]). Created By : Siau Pheng ([email protected]).
Created Date : December 20th, 2007. Created Date : December 20th, 2007.
Last Modified : April 22nd, 2022. Last Modified : March 20th, 2023.
(c) 2009 - 2022, 3FONIA Software; WWW.3FONIA.COM. (c) 2009 - 2023, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/ *******************************************************************/
:root { :root {
--bs-blue: #0d6efd;
--bs-indigo: #6610f2;
--bs-purple: #6f42c1;
--bs-pink: #d63384;
--bs-red: #dc3545;
--bs-orange: #fd7e14;
--bs-yellow: #ffc107;
--bs-green: #198754;
--bs-teal: #20c997;
--bs-cyan: #0dcaf0;
--bs-black: #000;
--bs-white: #fff;
--bs-gray: #8a93a2; --bs-gray: #8a93a2;
--bs-gray-dark: #636f83; --bs-gray-dark: #636f83;
--bs-gray-100: #ebedef; --bs-gray-100: #ebedef;
@@ -54,29 +42,14 @@
--bs-black-rgb: 0, 0, 21; --bs-black-rgb: 0, 0, 21;
--bs-body-color-rgb: 44, 56, 74; --bs-body-color-rgb: 44, 56, 74;
--bs-body-bg-rgb: 255, 255, 255; --bs-body-bg-rgb: 255, 255, 255;
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --bs-font-sans-serif: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0)); --bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: var(--bs-font-sans-serif); --bs-body-font-family: var(--bs-font-sans-serif);
--bs-body-font-size: .95rem; --bs-body-font-size: .95rem;
--bs-body-font-weight: 400; --bs-body-font-weight: 400;
--bs-body-line-height: 1.5; --bs-body-line-height: 1.2;
--bs-body-color: rgba(44, 56, 74, 0.95); --bs-body-color: rgba(44, 56, 74, 0.95);
--bs-body-bg: #fff;
--bs-border-width: 1px;
--bs-border-style: solid;
--bs-border-color: #dee2e6;
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
--bs-border-radius: 0.375rem;
--bs-border-radius-sm: 0.25rem;
--bs-border-radius-lg: 0.5rem;
--bs-border-radius-xl: 1rem;
--bs-border-radius-2xl: 2rem;
--bs-border-radius-pill: 50rem;
--bs-link-color: #0d6efd;
--bs-link-hover-color: #0a58ca;
--bs-code-color: #d63384;
--bs-highlight-bg: #fff3cd;
--bs-card-color: #000; --bs-card-color: #000;
} }
@@ -163,7 +136,7 @@ button.tbl-rowbtn.normal {/* */
/** navibar menu **/ /** navibar menu **/
.navbar-custom { .navbar-custom {
min-height: 4rem; min-height: 3.2rem;
background: #fff; background: #fff;
position: -webkit-sticky; position: -webkit-sticky;
position: sticky; position: sticky;
@@ -172,7 +145,7 @@ button.tbl-rowbtn.normal {/* */
box-shadow: 0 2px 2px 0 rgba(60, 75, 100, .14), 0 3px 1px -2px rgba(60, 75, 100, .12), 0 1px 5px 0 rgba(60, 75, 100, .20); box-shadow: 0 2px 2px 0 rgba(60, 75, 100, .14), 0 3px 1px -2px rgba(60, 75, 100, .12), 0 1px 5px 0 rgba(60, 75, 100, .20);
} }
.navbar-nav .nav-link { .navbar-nav .nav-link {
padding-left: 1.25rem !important; /*padding-left: 1.25rem !important;*/
} }
.navbar-nav .dropdown-toggle:after { .navbar-nav .dropdown-toggle:after {
border-width: .4em .4em 0 .4em; border-width: .4em .4em 0 .4em;
@@ -206,6 +179,13 @@ button.tbl-rowbtn.normal {/* */
.navbar-nav .dropdown-submenu:hover { .navbar-nav .dropdown-submenu:hover {
background-color: #ebedef; background-color: #ebedef;
} }
.navbar-nav .dropdown-item {
padding: 0.5rem 1rem;
}
.navbar-nav .dropdown-item:hover, .navbar-nav .dropdown-item:focus {
background-color: #42C2D5;
color: #fff;
}
.navbar-nav .dropdown-toggle.slink:after { .navbar-nav .dropdown-toggle.slink:after {
margin-left: auto; margin-left: auto;
} }
@@ -292,8 +272,8 @@ button.tbl-rowbtn.normal {/* */
} }
.icon-md, .icon-lg { .icon-md, .icon-lg {
height: 2.5rem; height: 2.1rem;
width: 2.5rem; width: 2.1rem;
font-size: 0.9em; font-size: 0.9em;
display: -webkit-inline-box; display: -webkit-inline-box;
display: -ms-inline-flexbox; display: -ms-inline-flexbox;
@@ -387,18 +367,18 @@ ul.dtr-details li.hidden { visibility: hidden !important; display: none !importa
/******************************** Autocomplete ********************************/ /******************************** Autocomplete ********************************/
.bs-fonac .dropdown-menu { .bootstrap-autocomplete.dropdown-menu{
max-height: 400px; max-height: 300px;
overflow-y: auto; overflow-y: scroll;
} }
.bs-fonac .dropdown-item { .bootstrap-autocomplete.dropdown-menu .dropdown-item {
padding: .5rem .8rem; overflow: hidden;
font-size: .9rem; text-overflow: ellipsis;
color: var(--bs-dropdown-link-color, #000000); cursor: pointer;
} }
.bs-fonac .dropdown-item:hover, .bs-fonac .dropdown-item:focus { /*.bs-fonac .dropdown-item:hover, .bs-fonac .dropdown-item:focus {
color: var(--bs-white, #ffffff); color: var(--bs-white, #ffffff);
background-color: var(--bs-blue, #ebedef); background-color: var(--bs-blue, #ebedef);
} }
@@ -413,7 +393,7 @@ ul.dtr-details li.hidden { visibility: hidden !important; display: none !importa
color: var(--bs-dropdown-link-disabled-color, #8a93a2); color: var(--bs-dropdown-link-disabled-color, #8a93a2);
pointer-events: none; pointer-events: none;
background-color: transparent; background-color: transparent;
} }*/
/******************************** text field ********************************/ /******************************** text field ********************************/
File diff suppressed because one or more lines are too long
+481 -1
View File
File diff suppressed because one or more lines are too long
+532 -445
View File
@@ -1,450 +1,537 @@
!(function (t) { var __extends = (undefined && undefined.__extends) || (function () {
var e = {}; var extendStatics = function (d, b) {
function s(i) { extendStatics = Object.setPrototypeOf ||
if (e[i]) return e[i].exports; ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
var o = (e[i] = { i: i, l: !1, exports: {} }); function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return t[i].call(o.exports, o, o.exports, s), (o.l = !0), o.exports; return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var BaseResolver = (function () {
function BaseResolver(options) {
this._settings = $.extend(true, {}, this.getDefaults(), options);
} }
(s.m = t), BaseResolver.prototype.getDefaults = function () {
(s.c = e), return {};
(s.d = function (t, e, i) { };
s.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: i }); BaseResolver.prototype.getResults = function (limit, start, end) {
}), return this.results;
(s.r = function (t) { };
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); BaseResolver.prototype.search = function (q, cbk) {
}), cbk(this.getResults());
(s.t = function (t, e) { };
if ((1 & e && (t = s(t)), 8 & e)) return t; return BaseResolver;
if (4 & e && "object" == typeof t && t && t.__esModule) return t; }());
var i = Object.create(null);
if ((s.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t)) var AjaxResolver = (function (_super) {
for (var o in t) __extends(AjaxResolver, _super);
s.d(i, function AjaxResolver(options) {
o, return _super.call(this, options) || this;
function (e) { }
return t[e]; AjaxResolver.prototype.getDefaults = function () {
}.bind(null, o) return {
); url: '',
return i; method: 'post',
}), queryKey: 'Auto_Query',
(s.n = function (t) { extraData: {},
var e = t && t.__esModule timeout: 0,
? function () { requestThrottling: 500
return t.default; };
} };
: function () { AjaxResolver.prototype.search = function (q, cbk) {
return t; var _this = this;
}; if (this.jqXHR != null) {
return s.d(e, "a", e), e; this.jqXHR.abort();
}), }
(s.o = function (t, e) { var data = {};
return Object.prototype.hasOwnProperty.call(t, e); data[this._settings.queryKey] = q;
}), $.extend(data, this._settings.extraData);
(s.p = ""), s((s.s = 0)); if (this.requestTID) {
})([ window.clearTimeout(this.requestTID);
function (t, e, s) { }
"use strict"; this.requestTID = window.setTimeout(function () {
s.r(e), _this.jqXHR = $.ajax(_this._settings.url, {
s.d(e, "AutoComplete", function () { method: _this._settings.method,
return a; data: data,
timeout: _this._settings.timeout
});
_this.jqXHR.done(function (result) {
//gnips: result in object
cbk((undefined !== result.autodata) ? result.autodata : result);
});
_this.jqXHR.fail(function (err) {
var _a;
(_a = _this._settings) === null || _a === void 0 ? void 0 : _a.fail(err);
});
_this.jqXHR.always(function () {
_this.jqXHR = null;
});
}, this._settings.requestThrottling);
};
return AjaxResolver;
}(BaseResolver));
var DropdownV5 = (function () {
function DropdownV5(e, formatItemCbk, autoSelect, noResultsText) {
this.initialized = false;
this.shown = false;
this.items = [];
this.ddMouseover = false;
this._$el = e;
this.formatItem = formatItemCbk;
this.autoSelect = autoSelect;
this.noResultsText = noResultsText;
}
DropdownV5.prototype.getElPos = function () {
var pos = $.extend({}, this._$el.position(), {
height: this._$el[0].offsetHeight
}); });
var i, return pos;
o = ((i = function (t, e) { };
return (i = DropdownV5.prototype.init = function () {
Object.setPrototypeOf || var _this = this;
({ __proto__: [] } instanceof Array && var pos = this.getElPos();
function (t, e) { this._dd = $('<div />');
t.__proto__ = e; this._dd.addClass('bootstrap-autocomplete dropdown-menu');
}) || this._dd.insertAfter(this._$el);
function (t, e) { this._dd.css({ top: pos.top + this._$el.outerHeight(), left: pos.left, width: this._$el.outerWidth() });
for (var s in e) e.hasOwnProperty(s) && (t[s] = e[s]); this._dd.on('click', '.dropdown-item', function (evt) {
})(t, e); //console.log('clicked', evt.currentTarget);
}), //console.log($(evt.currentTarget));
function (t, e) { var item = $(evt.currentTarget).data('item');
function s() { _this.itemSelectedLaunchEvent(item);
this.constructor = t; evt.preventDefault();
});
this._dd.on('keyup', function (evt) {
if (_this.shown) {
switch (evt.which) {
case 27:
_this.hide();
_this._$el.focus();
break;
}
return false;
}
});
this._dd.on('mouseenter', function (evt) {
_this.ddMouseover = true;
});
this._dd.on('mouseleave', function (evt) {
_this.ddMouseover = false;
});
this._dd.on('mouseenter', '.dropdown-item', function (evt) {
if (_this.haveResults) {
$(evt.currentTarget).closest('div').find('.dropdown-item.active').removeClass('active');
$(evt.currentTarget).addClass('active');
_this.mouseover = true;
}
});
this._dd.on('mouseleave', '.dropdown-item', function (evt) {
_this.mouseover = false;
});
this.initialized = true;
};
DropdownV5.prototype.checkInitialized = function () {
if (!this.initialized) {
this.init();
}
};
Object.defineProperty(DropdownV5.prototype, "isMouseOver", {
get: function () {
return this.mouseover;
},
enumerable: false,
configurable: true
});
Object.defineProperty(DropdownV5.prototype, "isDdMouseOver", {
get: function () {
return this.ddMouseover;
},
enumerable: false,
configurable: true
});
Object.defineProperty(DropdownV5.prototype, "haveResults", {
get: function () {
return (this.items.length > 0);
},
enumerable: false,
configurable: true
});
DropdownV5.prototype.focusNextItem = function (reversed) {
if (this.haveResults) {
var currElem = this._dd.find('.dropdown-item.active');
var nextElem = reversed ? currElem.prev() : currElem.next();
if (nextElem.length === 0) {
nextElem = reversed ? this._dd.find('.dropdown-item').last() : this._dd.find('.dropdown-item').first();
}
currElem.removeClass('active');
nextElem.addClass('active');
this.scrollTo(nextElem);
}
};
DropdownV5.prototype.focusPreviousItem = function () {
this.focusNextItem(true);
};
DropdownV5.prototype.selectFocusItem = function () {
this._dd.find('.dropdown-item.active').trigger('click');
};
Object.defineProperty(DropdownV5.prototype, "isItemFocused", {
get: function () {
if (this._dd && this.isShown() && (this._dd.find('.dropdown-item.active').length > 0)) {
return true;
}
return false;
},
enumerable: false,
configurable: true
});
DropdownV5.prototype.show = function () {
if (!this.shown) {
this._dd.addClass('show');
this.shown = true;
this._$el.trigger('autocomplete.dd.shown');
}
};
DropdownV5.prototype.isShown = function () {
return this.shown;
};
DropdownV5.prototype.hide = function () {
if (this.shown) {
this._dd.removeClass('show');
this.shown = false;
this._$el.trigger('autocomplete.dd.hidden');
}
};
DropdownV5.prototype.updateItems = function (items, searchText) {
this.items = items;
this.searchText = searchText;
this.refreshItemList();
};
DropdownV5.prototype.showMatchedText = function (text, qry) {
var startIndex = text.toLowerCase().indexOf(qry.toLowerCase());
if (startIndex > -1) {
var endIndex = startIndex + qry.length;
return text.slice(0, startIndex) + '<b>'
+ text.slice(startIndex, endIndex) + '</b>'
+ text.slice(endIndex);
}
return text;
};
DropdownV5.prototype.refreshItemList = function () {
var _this = this;
this.checkInitialized();
this._dd.empty();
var liList = [];
if (this.items.length > 0) {
this.items.forEach(function (item) {
var itemFormatted = _this.formatItem(item);
if (typeof itemFormatted === 'string') {
itemFormatted = { text: itemFormatted };
}
var itemText;
var itemHtml;
itemText = _this.showMatchedText(itemFormatted.text, _this.searchText);
if (itemFormatted.html !== undefined) {
itemHtml = itemFormatted.html;
}
else {
itemHtml = itemText;
}
var disabledItem = itemFormatted.disabled;
var li = $('<a >');
li.addClass('dropdown-item')
//css bisa dimasukkan ke style default + cursor select
//.css({ 'overflow': 'hidden', 'text-overflow': 'ellipsis' })
.html(itemHtml)
.data('item', item);
if (disabledItem) {
li.addClass('disabled');
}
liList.push(li);
});
this._dd.append(liList);
this.show();
}
else {
if (this.noResultsText === '') {
this.hide();
}
else {
var li = $('<a >');
li.addClass('dropdown-item disabled')
.html(this.noResultsText);
liList.push(li);
this._dd.append(liList);
this.show();
}
}
};
DropdownV5.prototype.itemSelectedLaunchEvent = function (item) {
this._$el.trigger('autocomplete.select', item);
};
DropdownV5.prototype.scrollTo = function (el) {
var _he = this._dd.height(), _to = this._dd.scrollTop(), _ito = el.position().top, _ihe = el.outerHeight(),
_nto = _to, _wra = false;
if (_ito < 0){
_wra = el.is(':first-child');
_nto = _wra ? 0 : _to - _he / 2;
} else if (_ito > _he - _ihe) {
_wra = el.is(':last-child') && _ito > _he;
_nto = _wra ? (_ito + _ihe - _he) : _to + _he / 2;
}
this._dd.scrollTop(_nto);
};
return DropdownV5;
}());
var AutoComplete = (function () {
function AutoComplete(element, options) {
this._selectedItem = null;
this._defaultValue = null;
this._defaultText = null;
this._settings = {
resolver: 'ajax',
resolverSettings: {},
minLength: 3,
valueKey: 'value',
formatResult: this.defaultFormatResult,
autoSelect: true,
noResultsText: 'Pencarian Tidak Ketemu',
preventEnter: false,
events: {
typed: null,
searchPre: null,
search: null,
searchPost: null,
select: null,
focus: null,
},
//gnips: adding callback and keydown function
selectFunc: function(){},
keydownFunc: function(){}
};
this._el = element;
this._$el = $(this._el);
this.manageInlineDataAttributes();
if (typeof options === 'object') {
this._settings = $.extend(true, {}, this.getSettings(), options);
}
this.init();
}
AutoComplete.prototype.manageInlineDataAttributes = function () {
var s = this.getSettings();
if (this._$el.data('url')) {
s.resolverSettings.url = this._$el.data('url');
}
if (this._$el.data('default-value')) {
this._defaultValue = this._$el.data('default-value');
}
if (this._$el.data('default-text')) {
this._defaultText = this._$el.data('default-text');
}
if (this._$el.data('noresults-text') !== undefined) {
s.noResultsText = this._$el.data('noresults-text');
}
};
AutoComplete.prototype.getSettings = function () {
return this._settings;
};
AutoComplete.prototype.init = function () {
this.bindDefaultEventListeners();
if (this._settings.resolver === 'ajax') {
this.resolver = new AjaxResolver(this._settings.resolverSettings);
}
this._dd = new DropdownV5(this._$el, this._settings.formatResult, this._settings.autoSelect, this._settings.noResultsText);
};
AutoComplete.prototype.bindDefaultEventListeners = function () {
var _this = this;
this._$el.on('keydown', function (evt) {
//gnips: call keydown function
('' == _this._$el.val() && _this._settings.keydownFunc(evt.which));
switch (evt.which) {
case 9:
if (_this._dd.isItemFocused) {
_this._dd.selectFocusItem();
} }
i(t, e), (t.prototype = null === e ? Object.create(e) : ((s.prototype = e.prototype), new s())); _this._dd.hide();
}), break;
n = (function (t) { case 13:
function e(e) { if (_this._dd.isItemFocused) {
return t.call(this, e) || this; _this._dd.selectFocusItem();
}
return (
o(e, t),
(e.prototype.getDefaults = function () {
return { url: "", method: "post", queryKey: "Auto_Query", extraData: {}, timeout: void 0, requestThrottling: 500 };
}),
(e.prototype.search = function (t, e) {
var s = this;
null != this.jqXHR && this.jqXHR.abort();
var i = {};
(i[this._settings.queryKey] = t),
$.extend(i, this._settings.extraData),
this.requestTID && window.clearTimeout(this.requestTID),
(this.requestTID = window.setTimeout(function () {
(s.jqXHR = $.ajax(s._settings.url, { method: s._settings.method, data: i, timeout: s._settings.timeout })),
s.jqXHR.done(function (t) {
var v;
(v = void 0 !== t.autodata ? t.autodata : t), e(v);
}),
s.jqXHR.fail(function (t) {
var e;
null === (e = s._settings) || void 0 === e || e.fail(t);
}),
s.jqXHR.always(function () {
s.jqXHR = null;
});
}, this._settings.requestThrottling));
}),
e
);
})(
(function () {
function t(t) {
this._settings = $.extend(!0, {}, this.getDefaults(), t);
} }
return ( _this._dd.hide();
(t.prototype.getDefaults = function () { if (_this._settings.preventEnter) {
return {}; evt.preventDefault();
}), }
(t.prototype.getResults = function (t, e, s) { break;
return this.results; case 40:
}), _this._dd.focusNextItem();
(t.prototype.search = function (t, e) { break;
e(this.getResults()); case 38:
}), _this._dd.focusPreviousItem();
t break;
); }
})() });
), this._$el.on('keyup', function (evt) {
l = (function () { switch (evt.which) {
function t(t, e, s, i) { case 16:
(this.initialized = !1), (this.shown = !1), (this.items = []), (this.ddMouseover = !1), (this._$el = t), (this.formatItem = e), (this.autoSelect = s), (this.noResultsText = i); case 17:
} case 18:
return ( case 39:
(t.prototype.getElPos = function () { case 37:
return $.extend({}, this._$el.position(), { height: this._$el[0].offsetHeight }); case 36:
}), case 35:
(t.prototype.init = function () { break;
var t = this, e = this.getElPos(); case 13:
(this._dd = $("<div />")), _this._dd.hide();
this._dd.addClass("bs-fonac dropdown-menu"), break;
this._dd.insertAfter(this._$el), case 27:
this._dd.css({ cssText: 'width: '+this._$el.outerWidth()+'px !important', top: e.top + this._$el.outerHeight(), left: e.left }), _this._dd.hide();
this._dd.on("click", ".dropdown-item", function (e) { break;
var s = $(e.currentTarget).data("item"); case 40:
t.itemSelectedLaunchEvent(s), e.preventDefault(); break;
}), case 38:
this._dd.on("keyup", function (e) { break;
if (t.shown) { default:
switch (e.which) { _this._selectedItem = null;
case 27: var newValue = _this._$el.val();
t.hide(), t._$el.focus(); _this.handlerTyped(newValue);
} }
return !1; });
} this._$el.on('blur', function (evt) {
}), if (!_this._dd.isMouseOver && _this._dd.isDdMouseOver && _this._dd.isShown()) {
this._dd.on("mouseenter", function (e) { setTimeout(function () { _this._$el.focus(); });
t.ddMouseover = !0; _this._$el.focus();
}), }
this._dd.on("mouseleave", function (e) { else if (!_this._dd.isMouseOver) {
t.ddMouseover = !1; _this._dd.hide();
}), }
this._dd.on("mouseenter", ".dropdown-item", function (e) { });
t.haveResults && ($(e.currentTarget).closest("div").find(".dropdown-item.active").removeClass("active"), $(e.currentTarget).addClass("active"), (t.mouseover = !0)); this._$el.on('autocomplete.select', function (evt, item) {
}), _this._selectedItem = item;
this._dd.on("mouseleave", ".dropdown-item", function (e) { _this.itemSelectedDefaultHandler(item);
t.mouseover = !1; });
}), this._$el.on('paste', function (evt) {
(this.initialized = !0); setTimeout(function () {
}), _this._$el.trigger('keyup', evt);
(t.prototype.checkInitialized = function () { }, 0);
this.initialized || this.init(); });
}), };
Object.defineProperty(t.prototype, "isMouseOver", { AutoComplete.prototype.handlerTyped = function (newValue) {
get: function () { if (this._settings.events.typed !== null) {
return this.mouseover; newValue = this._settings.events.typed(newValue, this._$el);
}, if (!newValue) {
enumerable: !1, return;
configurable: !0, }
}), }
Object.defineProperty(t.prototype, "isDdMouseOver", { if (newValue.length >= this._settings.minLength) {
get: function () { this._searchText = newValue;
return this.ddMouseover; this.handlerPreSearch();
}, }
enumerable: !1, else {
configurable: !0, this._dd.hide();
}), }
Object.defineProperty(t.prototype, "haveResults", { };
get: function () { AutoComplete.prototype.handlerPreSearch = function () {
return this.items.length > 0; if (this._settings.events.searchPre !== null) {
}, var newValue = this._settings.events.searchPre(this._searchText, this._$el);
enumerable: !1, if (!newValue)
configurable: !0, return;
}), this._searchText = newValue;
(t.prototype.focusNextItem = function (t) { }
if (this.haveResults) { this.handlerDoSearch();
var e = this._dd.find(".dropdown-item.active"), };
s = t ? e.prev() : e.next(); AutoComplete.prototype.handlerDoSearch = function () {
0 === s.length && (s = t ? this._dd.find(".dropdown-item").last() : this._dd.find(".dropdown-item").first()), e.removeClass("active"), s.addClass("active"); var _this = this;
} if (this._settings.events.search !== null) {
}), this._settings.events.search(this._searchText, function (results) {
(t.prototype.focusPreviousItem = function () { _this.postSearchCallback(results);
this.focusNextItem(!0); }, this._$el);
}), }
(t.prototype.selectFocusItem = function () { else {
this._dd.find(".dropdown-item.active").trigger("click"); if (this.resolver) {
}), this.resolver.search(this._searchText, function (results) {
Object.defineProperty(t.prototype, "isItemFocused", { _this.postSearchCallback(results);
get: function () {
return !!(this._dd && this.isShown() && this._dd.find(".dropdown-item.active").length > 0);
},
enumerable: !1,
configurable: !0,
}),
(t.prototype.show = function () {
if (!this.shown) {
this.getElPos();
this._dd.addClass("show"), (this.shown = !0), this._$el.trigger("autocomplete.dd.shown");
}
}),
(t.prototype.isShown = function () {
return this.shown;
}),
(t.prototype.hide = function () {
this.shown && (this._dd.removeClass("show"), (this.shown = !1), this._$el.trigger("autocomplete.dd.hidden"));
}),
(t.prototype.updateItems = function (t, e) {
(this.items = t), (this.searchText = e), this.refreshItemList();
}),
(t.prototype.showMatchedText = function (t, e) {
var s = t.toLowerCase().indexOf(e.toLowerCase());
if (s > -1) {
var i = s + e.length;
return t.slice(0, s) + "<b>" + t.slice(s, i) + "</b>" + t.slice(i);
}
return t;
}),
(t.prototype.refreshItemList = function () {
var t = this;
this.checkInitialized(), this._dd.empty();
var e = [];
if (this.items.length > 0)
this.items.forEach(function (s) {
var i, o, n = t.formatItem(s);
"string" == typeof n && (n = { text: n }),
(i = void 0 !== n.html ? n.html : n.text),
(o = t.showMatchedText(i, t.searchText));
var r = n.disabled, l = $("<a >");
l.addClass("dropdown-item").css({ overflow: "hidden", "text-overflow": "ellipsis" }).html(o).data("item", s), r && l.addClass("disabled"), e.push(l);
}),
this._dd.append(e),
this.show();
else if ("" === this.noResultsText) this.hide();
else {
var s = $("<a >");
s.addClass("dropdown-item disabled").html(this.noResultsText), e.push(s), this._dd.append(e), this.show();
}
}),
(t.prototype.itemSelectedLaunchEvent = function (t) {
this._$el.trigger("autocomplete.select", t);
}),
t
);
})(),
a = (function () {
function t(t, e) {
(this._selectedItem = null),
(this._defaultValue = null),
(this._defaultText = null),
(this._isSelectElement = !1),
(this._settings = {
resolver: "ajax",
resolverSettings: {},
minLength: 3,
valueKey: "value",
formatResult: this.defaultFormatResult,
autoSelect: !0,
noResultsText: "Tidak ditemukan data",
bootstrapVersion: "4",
preventEnter: !1,
events: { typed: null, searchPre: null, search: null, searchPost: null, select: null, focus: null },
keydownFunc: function(){},//gnips
}),
(this._el = t),
(this._$el = $(this._el)),
this._$el.is("select") && (this._isSelectElement = !0),
this.manageInlineDataAttributes(),
"object" == typeof e && (this._settings = $.extend(!0, {}, this.getSettings(), e)),
this._isSelectElement && this.convertSelectToText(),
this.init();
}
return (
(t.prototype.manageInlineDataAttributes = function () {
var t = this.getSettings();
this._$el.data("url") && (t.resolverSettings.url = this._$el.data("url")),
this._$el.data("default-value") && (this._defaultValue = this._$el.data("default-value")),
this._$el.data("default-text") && (this._defaultText = this._$el.data("default-text")),
void 0 !== this._$el.data("noresults-text") && (t.noResultsText = this._$el.data("noresults-text"));
}),
(t.prototype.getSettings = function () {
return this._settings;
}),
(t.prototype.getBootstrapVersion = function () {
var t;
"4" === this._settings.bootstrapVersion ? (t = [4])
: (console.error("INVALID value for 'bootstrapVersion' settings property: " + this._settings.bootstrapVersion + " defaulting to 4"), (t = [4]));
return t;
}),
(t.prototype.convertSelectToText = function () {
var e = $("<input>");
e.attr("type", "hidden"), e.attr("id", this._$el.attr("id")+'_AutoVal'), this._defaultValue && e.val(this._defaultValue), (this._selectHiddenField = e), e.insertAfter(this._$el);
var s = $("<input>");
s.attr("type", "search"),
s.attr("id", this._$el.attr("id")),
s.attr("disabled", this._$el.attr("disabled")),
s.attr("placeholder", this._$el.attr("placeholder")),
s.attr("autocomplete", "off"),
s.addClass(this._$el.attr("class")),
this._defaultText && s.val(this._defaultText);
var i = this._$el.attr("required");
i && s.attr("required", i), s.data(t.NAME, this), this._$el.replaceWith(s), (this._$el = s), (this._el = s.get(0));
}),
(t.prototype.init = function () {
this.bindDefaultEventListeners(),
"ajax" === this._settings.resolver && (this.resolver = new n(this._settings.resolverSettings)),
(this._dd = new l(this._$el, this._settings.formatResult, this._settings.autoSelect, this._settings.noResultsText));
}),
(t.prototype.bindDefaultEventListeners = function () {
var t = this;
this._$el.on("keydown", function (e) {
("" == t._$el.val() && t._settings.keydownFunc(e.which));//gnips
switch (e.which) {
case 9:
t._dd.isItemFocused ? t._dd.selectFocusItem() : t._selectedItem || ("" !== t._$el.val() && t._$el.trigger("autocomplete.freevalue", t._$el.val())), t._dd.hide();
break;
case 13:
t._dd.isItemFocused ? t._dd.selectFocusItem() : t._selectedItem || ("" !== t._$el.val() && t._$el.trigger("autocomplete.freevalue", t._$el.val())),
t._dd.hide(),
t._settings.preventEnter && e.preventDefault();
break;
case 40:
t._dd.focusNextItem();
break;
case 38:
t._dd.focusPreviousItem();
}
}),
this._$el.on("keyup", function (e) {
switch (e.which) {
case 16:
case 17:
case 18:
case 39:
case 37:
case 36:
case 35:
break;
case 13:
case 27:
t._dd.hide();
break;
case 40:
case 38:
break;
default:
t._selectedItem = null;
var s = t._$el.val();
t.handlerTyped(s);
}
}),
this._$el.on("blur", function (e) {
!t._dd.isMouseOver && t._dd.isDdMouseOver && t._dd.isShown()
? (setTimeout(function () {
t._$el.focus();
}),
t._$el.focus())
: t._dd.isMouseOver ||
/*(t._isSelectElement
? t._dd.isItemFocused
? t._dd.selectFocusItem()
: null !== t._selectedItem && "" !== t._$el.val()
? t._$el.trigger("autocomplete.select", t._selectedItem)
: "" !== t._$el.val() && null !== t._defaultValue
? (t._$el.val(t._defaultText), t._selectHiddenField.val(t._defaultValue), (t._selectedItem = null), t._$el.trigger("autocomplete.select", t._selectedItem))
: (t._$el.val(""), t._selectHiddenField.val(""), (t._selectedItem = null), t._$el.trigger("autocomplete.select", t._selectedItem))
: null === t._selectedItem && t._$el.trigger("autocomplete.freevalue", t._$el.val()),
t._dd.hide());*/ t._dd.hide();
}),
this._$el.on("autocomplete.select", function (e, s) {
(t._selectedItem = s), t.itemSelectedDefaultHandler(s);
}),
this._$el.on("paste", function (e) {
setTimeout(function () {
t._$el.trigger("keyup", e);
}, 0);
});
}),
(t.prototype.handlerTyped = function (t) {
(null === this._settings.events.typed || (t = this._settings.events.typed(t, this._$el))) && (t.length >= this._settings.minLength ? ((this._searchText = t), this.handlerPreSearch()) : this._dd.hide());
}),
(t.prototype.handlerPreSearch = function () {
if (null !== this._settings.events.searchPre) {
var t = this._settings.events.searchPre(this._searchText, this._$el);
if (!t) return;
this._searchText = t;
}
this.handlerDoSearch();
}),
(t.prototype.handlerDoSearch = function () {
var t = this;
null !== this._settings.events.search
? this._settings.events.search(
this._searchText,
function (e) {
t.postSearchCallback(e);
},
this._$el
)
: this.resolver &&
this.resolver.search(this._searchText, function (e) {
t.postSearchCallback(e);
});
}),
(t.prototype.postSearchCallback = function (t) {
(this._settings.events.searchPost && "boolean" == typeof (t = this._settings.events.searchPost(t, this._$el)) && !t) || this.handlerStartShow(t);
}),
(t.prototype.handlerStartShow = function (t) {
if (1 == t.length && 1 == (void 0 !== t[0].bc ? t[0].bc : 0)) {
this._$el.trigger("autocomplete.select", t[0]),
this._dd.hide();
} else this._dd.updateItems(t, this._searchText);
}),
(t.prototype.itemSelectedDefaultHandler = function (t) {
if (null != t) {
var e = this._settings.formatResult(t);
"string" == typeof e && (e = { text: e }), this._$el.val(e.text), this._isSelectElement && this._selectHiddenField.val(e.value);
} else this._$el.val(""), this._isSelectElement && this._selectHiddenField.val("");
(this._selectedItem = t), this._dd.hide();
}),
(t.prototype.defaultFormatResult = function (t) {
return "string" == typeof t ? { text: t } : t.text ? t : { text: t.toString() };
}),
(t.prototype.manageAPI = function (t, e) {
"set" === t ? this.itemSelectedDefaultHandler(e) : "clear" === t ? this.itemSelectedDefaultHandler(null) : "show" === t ? this._$el.trigger("keyup") : "updateResolver" === t && (this.resolver = new n(e));
}),
(t.NAME = "autoComplete"),
t
);
})();
!(function (t, e, s) {
t.fn[a.NAME] = function (e, s) {
return this.each(function () {
var i;
(i = t(this).data(a.NAME)) || ((i = new a(this, e)), t(this).data(a.NAME, i)), i.manageAPI(e, s);
}); });
}; }
})(jQuery, window, document); }
}, };
]); AutoComplete.prototype.postSearchCallback = function (results) {
if (this._settings.events.searchPost) {
results = this._settings.events.searchPost(results, this._$el);
if ((typeof results === 'boolean') && !results)
return;
}
this.handlerStartShow(results);
};
AutoComplete.prototype.handlerStartShow = function (results) {
//gnips: adding auto select when barcode result of 1 item only
if (1 == results.length && 1 == (void 0 !== results[0].bc ? results[0].bc : 0)) {
this._$el.trigger('autocomplete.select', results[0]),
this._dd.hide();
} else this._dd.updateItems(results, this._searchText);
};
AutoComplete.prototype.itemSelectedDefaultHandler = function (item) {
if (item != null) {
var itemFormatted = this._settings.formatResult(item);
if (typeof itemFormatted === 'string') {
itemFormatted = { text: itemFormatted };
}
this._$el.val(itemFormatted.text);
}
else {
this._$el.val('');
}
this._selectedItem = item;
//gnips: callback with selected item
this._settings.selectFunc(item);
this._dd.hide();
};
AutoComplete.prototype.defaultFormatResult = function (item) {
if (typeof item === 'string') {
return { text: item };
}
else if (item.text) {
return item;
}
else {
return { text: item.toString() };
}
};
AutoComplete.prototype.manageAPI = function (APICmd, params) {
if (APICmd === 'set') {
this.itemSelectedDefaultHandler(params);
}
else if (APICmd === 'clear') {
this.itemSelectedDefaultHandler(null);
}
else if (APICmd === 'show') {
this._$el.trigger('keyup');
}
else if (APICmd === 'updateResolver') {
this.resolver = new AjaxResolver(params);
}
};
AutoComplete.NAME = 'autoComplete';
return AutoComplete;
}());
(function ($, window, document) {
$.fn[AutoComplete.NAME] = function (optionsOrAPI, optionalParams) {
return this.each(function () {
var pluginClass;
pluginClass = $(this).data(AutoComplete.NAME);
if (!pluginClass) {
pluginClass = new AutoComplete(this, optionsOrAPI);
$(this).data(AutoComplete.NAME, pluginClass);
}
pluginClass.manageAPI(optionsOrAPI, optionalParams);
});
};
})(jQuery, window, document);
+34 -72
View File
@@ -4,9 +4,9 @@
Desc. : JS - Fonia Custom Class v3 Desc. : JS - Fonia Custom Class v3
Created By : Siau Pheng ([email protected]). Created By : Siau Pheng ([email protected]).
Created Date : June 19th, 2009. Created Date : June 19th, 2009.
Last Modified : May 3rd, 2022. Last Modified : March 24th, 2023.
(c) 2009 - 2022, 3FONIA Software; WWW.3FONIA.COM. (c) 2009 - 2023, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/ *******************************************************************/
@@ -105,7 +105,7 @@ var FoniaJS = {
url: this.WEB_PATH + "apps/php/" + apop.php, url: this.WEB_PATH + "apps/php/" + apop.php,
sendParam: ["data=default"], sendParam: ["data=default"],
onSuccess: function(txt) { onSuccess: function(txt) {
this.showWindowDetail(apop.kode, apop.title, txt, apop.width, apop.button, 'static', function(){ this.showWindow(apop.kode, apop.title, txt, apop.width, apop.button, function(){
if (typeof window[apop.func]['loading'] === 'function') window[apop.func]['loading'](q); if (typeof window[apop.func]['loading'] === 'function') window[apop.func]['loading'](q);
}); });
}.bind(this) }.bind(this)
@@ -341,21 +341,19 @@ var FoniaJS = {
} }
return smenu; return smenu;
}, },
FormDecorated: function() { FormDecorated: function() {//oke
$("input").each(function() { $('input').each(function() {
if ($(this).hasClass("integer") || $(this).hasClass("angka")) { // 16:shift 17:ctrl 18:alt 35:end 36:home 37:left 38:up 39:right 40:down 9:tab 13:enter 27:esc
// 8:backspace 46:delete 45:delete 48-57/96-105:num 110/190:dot 109/189/173:minus 107/187/61:plus
if ($(this).hasClass('integer') || $(this).hasClass('angka')) {
$(this).keydown(function(e) { $(this).keydown(function(e) {
var key = e.charCode || e.keyCode || 0; var key = e.keyCode ?? e.which;
return (key==8 || key==9 || key==13 || key==46 || key==110 || key==190 || (key>=35 && key<=40) || (key>=48 && key<=57) || (key>=96 && key<=105)); return (jQuery.inArray(key,[8,9,13,46,110,190])!==-1 || (key>=16 && key<=18) || (key>=35 && key<=40) || (key>=48 && key<=57) || (key>=96 && key<=105));
// allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY
// home, end, period, and numpad decimal
}); });
} else if ($(this).hasClass("number")) { } else if ($(this).hasClass('number')) {
$(this).keydown(function(e) { $(this).keydown(function(e) {
var key = e.charCode || e.keyCode || 0; var key = e.keyCode ?? e.which;
return (key==8 || key==9 || key==13 || key==46 || key==110 || key==190 || (key>=35 && key<=40) || (key>=48 && key<=57) || (key>=96 && key<=105) || key==109 || key==173); return (jQuery.inArray(key,[8,9,13,46,110,190,109,189,173])!==-1 || (key>=16 && key<=18) || (key>=35 && key<=40) || (key>=48 && key<=57) || (key>=96 && key<=105));
// allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY
// home, end, period, numpad decimal, minus, minus-ff
}); });
$(this).focus(function() { $(this).focus(function() {
$(this).val( FoniaJS.StrToFloat($(this).val()) ); $(this).val( FoniaJS.StrToFloat($(this).val()) );
@@ -363,36 +361,10 @@ var FoniaJS = {
$(this).blur(function() { $(this).blur(function() {
$(this).val( FoniaJS.FloatToStr($(this).val(), 0) ); $(this).val( FoniaJS.FloatToStr($(this).val(), 0) );
}); });
} else if ($(this).hasClass("double")) { } else if ($(this).hasClass('double')) {
$(this).keydown(function(e) { $(this).keydown(function(e) {
var key = e.charCode || e.keyCode || 0; var key = e.keyCode ?? e.which;
return (key==8 || key==9 || key==13 || key==46 || key==110 || key==190 || (key>=35 && key<=40) || (key>=48 && key<=57) || (key>=96 && key<=105) || key==109 || key==173); return (jQuery.inArray(key,[8,9,13,46,110,190,109,189,173])!==-1 || (key>=16 && key<=18) || (key>=35 && key<=40) || (key>=48 && key<=57) || (key>=96 && key<=105));
// allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY
// home, end, period, numpad decimal, minus, minus-ff
/*var ctrlDown = false;
var ctrlKey = 17, vKey = 86, cKey = 67;
if (e.keyCode === ctrlKey){
ctrlDown = true;
}
// Allow: backspace, delete, tab, escape, enter and .
if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110]) !== -1 ||
// Allow: Ctrl
(e.keyCode === ctrlKey) ||
// Allow: Ctrl+A
(e.keyCode === 65 && e.ctrlKey === true) ||
// Allow: Ctrl+v
(e.keyCode === vKey && ctrlDown) ||
// Allow: Ctrl+c
(e.keyCode === cKey && ctrlDown) ||
// Allow: home, end, left, right, down, up
(e.keyCode >= 35 && e.keyCode <= 40)) {
// let it happen, don't do anything
return;
}
// Ensure that it is a number and stop the keypress
if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
e.preventDefault();
}*/
}); });
$(this).focus(function() { $(this).focus(function() {
$(this).val( FoniaJS.StrToFloat($(this).val()) ); $(this).val( FoniaJS.StrToFloat($(this).val()) );
@@ -401,14 +373,12 @@ var FoniaJS = {
$(this).blur(function() { $(this).blur(function() {
$(this).val( FoniaJS.FloatToStr($(this).val(), 2) ); $(this).val( FoniaJS.FloatToStr($(this).val(), 2) );
}); });
} else if ($(this).hasClass("phone")) { } else if ($(this).hasClass('phone')) {
$(this).keyup(function() { $(this).keyup(function() {
var key = e.charCode || e.keyCode || 0; var key = e.keyCode ?? e.which;
return (key==8 || key==9 || key==13 || key==46 || key==110 || key==190 || (key>=35 && key<=40) || (key>=48 && key<=57) || (key>=96 && key<=105) || key==109 || key==173 || key==107); return (jQuery.inArray(key,[8,9,13,46,110,190,109,189,173,107,187,61])!==-1 || (key>=16 && key<=18) || (key>=35 && key<=40) || (key>=48 && key<=57) || (key>=96 && key<=105));
// allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY
// home, end, period, numpad decimal, minus, minus-ff, add
}); });
} else if ($(this).hasClass("error") && $(this).val()) { } else if ($(this).hasClass('error') && $(this).val()) {
var tmp_str = $(this).val(); var tmp_str = $(this).val();
$(this).val(''); $(this).val('');
FoniaJS.showError(tmp_str); FoniaJS.showError(tmp_str);
@@ -418,20 +388,22 @@ var FoniaJS = {
var _opts = {tags: false, theme: 'bootstrap-5'}; var _opts = {tags: false, theme: 'bootstrap-5'};
var _dmodal = $(this).closest('div.modal'); var _dmodal = $(this).closest('div.modal');
if ($(_dmodal).hasClass('modal')) _opts.dropdownParent = _dmodal; if ($(_dmodal).hasClass('modal')) _opts.dropdownParent = _dmodal;
$(this).select2(_opts).on('select2:close', function(e){ $(this).valid(); }); var _sel2 = $(this).select2(_opts);
if ($(this).prop('required')) _sel2.on('select2:close', function(e){ $(this).valid(); });
}); });
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
$(".colorpic").each(function() { $('.colorpic').each(function() {
$(this).prop('background-color', $(this).val()); $(this).prop('background-color', $(this).val());
}); });
if('function' == typeof jQuery.fn.datepicker){ if('function' == typeof jQuery.fn.datepicker){
$(".pickdate").datepicker({ $('.pickdate').datepicker({
format: 'dd-mm-yyyy', format: 'dd-mm-yyyy',
weekStart: 1, weekStart: 1,
language: 'id', language: 'id',
autoclose: true, autoclose: true,
todayHighlight: true todayHighlight: true,
enableOnReadonly: false
}); });
} }
if ('function' == typeof autosize) autosize($('textarea')); if ('function' == typeof autosize) autosize($('textarea'));
@@ -562,12 +534,9 @@ var FoniaJS = {
}); });
}).modal('show'); }).modal('show');
}, },
showWindow: function(id_wind, s_judul, s_isi, i_width, s_toolb, f_onload) {//oke showWindow: function(id_wind, s_judul, s_isi, i_width, s_toolb, f_onload, b_scroll) {//oke
return this.showWindowDetail(id_wind, s_judul, s_isi, i_width, s_toolb, 'static', f_onload); var t_width = '', t_toolb = '', t_scroll = (typeof b_scroll == 'boolean' && b_scroll == false) ? '' : 'modal-dialog-scrollable';
}, var f_oncall = (typeof f_onload == "function") ? f_onload : function(){};
showWindowDetail: function(id_wind, s_judul, s_isi, i_width, s_toolb, s_block, f_onload) {//oke
var t_width = '', t_toolb = '';
var f_oncall = (typeof f_onload == "function") ? f_onload : function() {};
if (i_width <= 300) { t_width = 'modal-sm'; } else if (i_width <= 300) { t_width = 'modal-sm'; } else
if (i_width <= 400) { t_width = 'modal-400'; } else if (i_width <= 400) { t_width = 'modal-400'; } else
if (i_width <= 500) { t_width = 'modal-500'; } else if (i_width <= 500) { t_width = 'modal-500'; } else
@@ -580,8 +549,8 @@ var FoniaJS = {
t_toolb += '</div>'; t_toolb += '</div>';
} }
var _wtxt = var _wtxt =
'<div class="modal fade" id="win'+id_wind+'" tabindex="-1" data-bs-keyboard="false"'+(s_block==''?'':' data-bs-backdrop="'+s_block+'"')+' aria-labelledby="win'+id_wind+'Label" aria-hidden="true">'+ '<div class="modal fade" id="win'+id_wind+'" tabindex="-1" data-bs-keyboard="false" data-bs-backdrop="static" aria-labelledby="win'+id_wind+'Label" aria-hidden="true">'+
'<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable '+t_width+'">'+ '<div class="modal-dialog modal-dialog-centered '+t_scroll+' '+t_width+'">'+
'<div class="modal-content">'+ '<div class="modal-content">'+
'<div class="modal-header"><h5 class="modal-title" id="win'+id_wind+'Label">'+s_judul+'</h5><button class="btn-close" type="button" data-bs-dismiss="modal" aria-label="Close"></button></div>'+ '<div class="modal-header"><h5 class="modal-title" id="win'+id_wind+'Label">'+s_judul+'</h5><button class="btn-close" type="button" data-bs-dismiss="modal" aria-label="Close"></button></div>'+
'<div class="modal-body">'+s_isi+'</div>'+ t_toolb + '<div class="modal-body">'+s_isi+'</div>'+ t_toolb +
@@ -650,26 +619,19 @@ var FoniaJS = {
}, this.locales[this.deflocal]); }, this.locales[this.deflocal]);
} }
}, },
Text_Auto: function(elm, turl, aparam, func_comp, func_key){ AutoComplete: function(elm, turl, aparam, func_comp, func_key){//oke
var arrData = [], objComp = {}; var arrData = [], objComp = {};
if ('string' !== typeof aparam) arrData = this.RequestParam(aparam); if ('string' !== typeof aparam) arrData = this.RequestParam(aparam);
objComp = { objComp = {
//preventEnter: false,
resolverSettings: { resolverSettings: {
url: turl, url: turl,
extraData: arrData.reduce(function(o, val) { var t = val.split('='); o[t[0]] = t[1]; return o; }, {}) extraData: arrData.reduce(function(o, val) { var t = val.split('='); o[t[0]] = t[1]; return o; }, {})
} }
}; };
if ('function' === typeof func_key) objComp.keydownFunc = func_key; if ('function' === typeof func_key) objComp.keydownFunc = func_key;
if ('function' === typeof func_comp) objComp.selectFunc = func_comp;
$(elm).autoComplete(objComp); $(elm).autoComplete(objComp);
if ('function' === typeof func_comp) {
$(elm).unbind('autocomplete.select');
$(elm).on('autocomplete.select', function (evt, item) {
('object' == typeof item) && func_comp(item);
});
$(elm).on('keydown', function(e){
if (13 === e.keyCode) return false;
});
}
}, },
getAppID: function() { getAppID: function() {
return this.APP_ID; return this.APP_ID;
+2 -2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -95,7 +95,7 @@ final class App {
// perubahan variabel dari data konfigurasi // perubahan variabel dari data konfigurasi
$asrc = array("[_CREATOR_NAME_]", "[_CREATOR_WEBSITE_]", "[_CREATOR_YEAR_]", "[_APP_NAME_VER_]", "[_APP_NAMES_VER_]", "[_APP_NAME_]", "[_APP_NAMES_]", "[_APP_NAMES_UP_]", "[_APP_VER_]", "[_APP_UPDATED_]", "[_REG_ID_]", "[_REG_NAME_]", "[_REG_NAME_UP_]", "[_REG_ADDRESS_]", "[_REG_CITY_]", "[_REG_CITY_UP_]", "[_REG_PHONE_]", "[_REG_FAX_]", "[_REG_EMAIL_]", "[_REG_POSTCODE_]", "[_REG_WEBSITE_]", "[_REG_YEAR_]", "[_USER_LASTLOG_]", "[_USER_IMG_]", "[_WEB_PATH_]", "[_NAVI_SIDEBAR_]", "[_NAVI_HEADER_]"); $asrc = array("[_CREATOR_NAME_]", "[_CREATOR_WEBSITE_]", "[_CREATOR_YEAR_]", "[_APP_NAME_VER_]", "[_APP_NAMES_VER_]", "[_APP_NAME_]", "[_APP_NAMES_]", "[_APP_NAMES_UP_]", "[_APP_VER_]", "[_APP_UPDATED_]", "[_REG_ID_]", "[_REG_NAME_]", "[_REG_NAME_UP_]", "[_REG_ADDRESS_]", "[_REG_CITY_]", "[_REG_CITY_UP_]", "[_REG_PHONE_]", "[_REG_FAX_]", "[_REG_EMAIL_]", "[_REG_POSTCODE_]", "[_REG_WEBSITE_]", "[_REG_YEAR_]", "[_USER_LASTLOG_]", "[_USER_IMG_]", "[_WEB_PATH_]", "[_NAVI_SIDEBAR_]", "[_NAVI_HEADER_]");
$adst = array($this->apps['CREATOR_NAME'], $this->apps['CREATOR_WEBSITE'], $this->apps['CREATOR_YEAR'], $this->apps['APP_NAME']." v".$this->apps['APP_VER'], $this->apps['APP_NAMES']." v".$this->apps['APP_VER'], $this->apps['APP_NAME'], $this->apps['APP_NAMES'], strtoupper($this->apps['APP_NAMES']), $this->apps['APP_VER'], $this->apps['APP_UPDATED'], $this->reg->reg_id(), $this->apps['REG_NAME'], strtoupper($this->apps['REG_NAME']), $this->apps['REG_ADDRESS'], $this->apps['REG_CITY'], strtoupper($this->apps['REG_CITY']), $this->apps['REG_PHONE'], $this->apps['REG_FAX'], $this->apps['REG_EMAIL'], $this->apps['REG_POSTCODE'], $this->apps['REG_WEBSITE'], $this->apps['REG_YEAR'], $this->auser['user_info'] ?? "[none]", "profiles/".$this->auser['user_img'], $this->apps['WEB_PATH'], $tnaviside, $tnavihead); $adst = array($this->apps['CREATOR_NAME'], $this->apps['CREATOR_WEBSITE'], $this->apps['CREATOR_YEAR'], $this->apps['APP_NAME']." v".$this->apps['APP_VER'], $this->apps['APP_NAMES']." v".$this->apps['APP_VER'], $this->apps['APP_NAME'], $this->apps['APP_NAMES'], strtoupper($this->apps['APP_NAMES']??""), $this->apps['APP_VER'], $this->apps['APP_UPDATED'], $this->reg->reg_id(), $this->apps['REG_NAME'], strtoupper($this->apps['REG_NAME']??""), $this->apps['REG_ADDRESS'], $this->apps['REG_CITY'], strtoupper($this->apps['REG_CITY']??""), $this->apps['REG_PHONE'], $this->apps['REG_FAX'], $this->apps['REG_EMAIL'], $this->apps['REG_POSTCODE'], $this->apps['REG_WEBSITE'], $this->apps['REG_YEAR'], $this->auser['user_info'] ?? "[none]", "profiles/".$this->auser['user_img'], $this->apps['WEB_PATH'], $tnaviside, $tnavihead);
$buffer = str_replace($asrc, $adst, $buffer); $buffer = str_replace($asrc, $adst, $buffer);
if (isset($this->auser) && is_array($this->auser)) { if (isset($this->auser) && is_array($this->auser)) {
+1 -1
View File
@@ -81,7 +81,7 @@ final class MySQL {
function SafeSQL($str) { function SafeSQL($str) {
if (!$this->cnn) $this->Connect(); if (!$this->cnn) $this->Connect();
return mysqli_real_escape_string($this->cnn, $str); return mysqli_real_escape_string($this->cnn, strval($str));
} }
function &Query($stqry = "", $dbname = "") { function &Query($stqry = "", $dbname = "") {
+19 -12
View File
@@ -3,12 +3,12 @@
/******************************************************************* /*******************************************************************
Module : /Function/Misc.php Module : /Function/Misc.php
Desc. : v4 - Fungsi Custom Lain Lain Desc. : v3 - Fungsi Custom Lain Lain
Created By : Siau Pheng (siaupheng@3fonia.com). Created By : Siau Pheng (siaupheng@3fonia.com).
Created Date : January 27th, 2008. Created Date : January 27th, 2008.
Last Modified : May 6th, 2021. Last Modified : March 30th, 2023.
(c) 2008 - 2021, 3FONIA Software; WWW.3FONIA.COM. (c) 2008 - 2023, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/ *******************************************************************/
@@ -134,8 +134,9 @@ if (!function_exists('abjad')) {
if (!function_exists('checkbox')) { if (!function_exists('checkbox')) {
function checkbox($nilai = 0) { function checkbox($nilai = 0) {
$bhasil = ((is_string($nilai) && ($nilai=="N" || $nilai=="0")) or (is_numeric($nilai) && $nilai==0) or (is_bool($nilai) && $nilai==false)) ? true : false; $thasil = ((is_string($nilai) && ($nilai=="N" || $nilai=="0")) or (is_numeric($nilai) && $nilai==0) or (is_bool($nilai) && $nilai==false)) ? "circle text-secondary" : "check-circle text-info";
return '<input class="form-check-input" type="checkbox" '.(($bhasil)?"":"checked").' readonly />'; return '<i class="fs-6 cui-'.$thasil.'"></i>';
//return '<input class="form-check-input" type="checkbox" '.(($bhasil)?"":"checked").' readonly />';
} }
} }
@@ -204,12 +205,6 @@ if (!function_exists('tgl_range_hari')) {
} }
} }
if (!function_exists('bulan_array')) {
function bulan_array() {
return array("1"=>"Januari","2"=>"Februari","3"=>"Maret","4"=>"April","5"=>"Mei","6"=>"Juni","7"=>"Juli","8"=>"Agustus","9"=>"September","10"=>"Oktober","11"=>"November","12"=>"Desember");
}
}
if (!function_exists('tgl_akhbln')) { if (!function_exists('tgl_akhbln')) {
function tgl_akhbln($tgl) { function tgl_akhbln($tgl) {
$atgl = explode("-", $tgl); $atgl = explode("-", $tgl);
@@ -258,6 +253,18 @@ if (!function_exists('tgl_triwulan')) {
} }
} }
if (!function_exists('bulan_array')) {
function bulan_array() {
return array("1"=>"Januari","2"=>"Februari","3"=>"Maret","4"=>"April","5"=>"Mei","6"=>"Juni","7"=>"Juli","8"=>"Agustus","9"=>"September","10"=>"Oktober","11"=>"November","12"=>"Desember");
}
}
if (!function_exists('triwulan_array')) {
function triwulan_array() {
return ["1"=>"Triwulan 1","2"=>"Triwulan 2","3"=>"Triwulan 3","4"=>"Triwulan 4"];
}
}
/*************************** FORMAT TAMPILAN & ERROR *****************************/ /*************************** FORMAT TAMPILAN & ERROR *****************************/
if (!function_exists('subjudul')) { if (!function_exists('subjudul')) {
@@ -281,7 +288,7 @@ if (!function_exists('br2nl')) {
if (!function_exists('isi_nol')) { if (!function_exists('isi_nol')) {
function isi_nol($nilai = "0", $panjang = 1) { function isi_nol($nilai = "0", $panjang = 1) {
$nilai = strval($nilai); $nilai = strval($nilai);
return str_repeat("0", $panjang-strlen($nilai)).$nilai; return ($panjang>strlen($nilai) ? str_repeat("0", $panjang-strlen($nilai)):'').$nilai;
} }
} }
+17 -7
View File
@@ -3,12 +3,12 @@
/******************************************************************* /*******************************************************************
Module : /Web/Form.php Module : /Web/Form.php
Desc. : v4 - Form Generator (jQuery & Bootstrap) Desc. : v3 - Form Generator (jQuery & Bootstrap)
Created By : Siau Pheng (siaupheng@3fonia.com). Created By : Siau Pheng (siaupheng@3fonia.com).
Created Date : February 27th, 2008. Created Date : February 27th, 2008.
Last Modified : April 17th, 2022. Last Modified : March 24th, 2023.
(c) 2008 - 2022, 3FONIA Software; WWW.3FONIA.COM. (c) 2008 - 2023, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/ *******************************************************************/
@@ -44,7 +44,7 @@ final class Form {
} }
$tout .= '<option value="'.$key.'"'.$olabel; $tout .= '<option value="'.$key.'"'.$olabel;
$aval = array($tvalue); $aval = array($tvalue);
if ($bmulti==true) $aval = explode(",", $tvalue); if ($bmulti==true) $aval = explode(",", ($tvalue ?? "0"));
$tout .= (in_array($key, $aval)) ? ' selected="selected"' : ""; $tout .= (in_array($key, $aval)) ? ' selected="selected"' : "";
$tout .= '>'.$_val2.'</option>'; $tout .= '>'.$_val2.'</option>';
} }
@@ -131,7 +131,7 @@ final class Form {
$bhasil = ((is_string($tvalue) && in_array($tvalue,array("N","T","0"))) or (is_numeric($tvalue) && $tvalue==0) or (is_bool($tvalue) && $tvalue===false) or empty($tvalue)) ? true : false; $bhasil = ((is_string($tvalue) && in_array($tvalue,array("N","T","0"))) or (is_numeric($tvalue) && $tvalue==0) or (is_bool($tvalue) && $tvalue===false) or empty($tvalue)) ? true : false;
$_enab = ($benable==true) ? "" : ' disabled=true'; $_enab = ($benable==true) ? "" : ' disabled=true';
$_req = ($breq==true) ? " required=true" : ""; $_req = ($breq==true) ? " required=true" : "";
$_change = ($tchange==null) ? ' onchange="this.value=(this.checked)?\''.$avalue[0].'\':\''.$avalue[1].'\';"' : ' onchange="this.value=(this.checked)?\''.$avalue[0].'\':\''.$avalue[1].'\';'.$tchange.'"'; $_change = ' onchange="this.value=(this.checked)?\''.$avalue[0].'\':\''.$avalue[1].'\';'.($tchange==null?'':$tchange).'"';
$tout = '<div class="form-check form-check-inline mr-1"><input type="checkbox" class="form-check-input" id="'.$tfield.'" name="'.$tfield.'" value="'.($bhasil?$avalue[1]:$avalue[0]).'"'.$_enab.$_change.$_req; $tout = '<div class="form-check form-check-inline mr-1"><input type="checkbox" class="form-check-input" id="'.$tfield.'" name="'.$tfield.'" value="'.($bhasil?$avalue[1]:$avalue[0]).'"'.$_enab.$_change.$_req;
$tout .= ($bhasil==false) ? ' checked="checked"' : ''; $tout .= ($bhasil==false) ? ' checked="checked"' : '';
$tout .= '></div>'; $tout .= '></div>';
@@ -203,7 +203,17 @@ final class Form {
return $tout; return $tout;
} }
public function textauto($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $holdtxt=null, $nmaxsize=null, $thelp="") { public function textauto($tlabel="", $tfield, $avalue=['value'=>0,'text'=>""], $benable=true, $breq=false, $holdtxt=null, $nmaxsize=null, $thelp="") {
$_enab = ($benable==true) ? "" : ' disabled=true';
$_req = ($breq==true) ? " required=true" : "";
$_max = ($nmaxsize==null) ? "" : ' maxlength="'.$nmaxsize.'"';
$_holdtxt = ($holdtxt==null) ? "" : ' placeholder="'.$holdtxt.'"';
$tout = '<input type="search" class="form-control" id="'.$tfield.'" name="'.$tfield.'" value="'.$avalue['text'].'"'.$_enab.$_max.$_holdtxt.$_req.' autocomplete="off" />';
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
return $tout;
}
/*public function textauto($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $holdtxt=null, $nmaxsize=null, $thelp="") {
$tvalue = ($tvalue==null) ? array('value'=>0, 'text'=>"") : $tvalue; $tvalue = ($tvalue==null) ? array('value'=>0, 'text'=>"") : $tvalue;
$_enab = ($benable==true) ? "" : ' disabled=true'; $_enab = ($benable==true) ? "" : ' disabled=true';
$_req = ($breq==true) ? " required=true" : ""; $_req = ($breq==true) ? " required=true" : "";
@@ -212,7 +222,7 @@ final class Form {
$tout = '<select class="form-control" id="'.$tfield.'" name="'.$tfield.'" default-value="'.$tvalue['value'].'" default-text="'.$tvalue['text'].'"'.$_enab.$_max.$_holdtxt.$_req.' /></select>'; $tout = '<select class="form-control" id="'.$tfield.'" name="'.$tfield.'" default-value="'.$tvalue['value'].'" default-text="'.$tvalue['text'].'"'.$_enab.$_max.$_holdtxt.$_req.' /></select>';
$this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout); $this->__aform[$tfield] = array('label'=>$tlabel, 'help'=>$thelp, 'form'=>$tout);
return $tout; return $tout;
} }*/
public function datebox($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $thelp="", $tkeyup=null, $tblur=null) { public function datebox($tlabel="", $tfield, $tvalue=null, $benable=true, $breq=false, $thelp="", $tkeyup=null, $tblur=null) {
if ($tvalue<>null) $tvalue = tgl_sql2str($tvalue); if ($tvalue<>null) $tvalue = tgl_sql2str($tvalue);
+2 -2
View File
@@ -102,14 +102,14 @@ final class Menu {
$ticon = ($amodul[$i]['Icon']) ? '<i class="me-2 '.$amodul[$i]['Icon'].'"></i>' : ""; $ticon = ($amodul[$i]['Icon']) ? '<i class="me-2 '.$amodul[$i]['Icon'].'"></i>' : "";
if (isset($amodul[$i+1]) && ($amodul[$i+1]['Level']>$amodul[$i]['Level'])) {//have submenu if (isset($amodul[$i+1]) && ($amodul[$i+1]['Level']>$amodul[$i]['Level'])) {//have submenu
if ($amodul[$i]['Level']==$mulai_level) { if ($amodul[$i]['Level']==$mulai_level) {
$thasil .= '<li class="nav-item pe-3 dropdown"><a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a><ul class="dropdown-menu" data-bs-popper="none">'; $thasil .= '<li class="nav-item pe-4 dropdown"><a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a><ul class="dropdown-menu" data-bs-popper="none">';
} else { } else {
$thasil .= '<li class="dropdown-submenu"><a class="dropdown-item dropdown-toggle slink" data-bs-toggle="dropdown" aria-expanded="false" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a><ul class="dropdown-menu" data-bs-popper="none">'; $thasil .= '<li class="dropdown-submenu"><a class="dropdown-item dropdown-toggle slink" data-bs-toggle="dropdown" aria-expanded="false" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a><ul class="dropdown-menu" data-bs-popper="none">';
} }
} else if (trim($amodul[$i]['Menu'])=="-" && $amodul[$i]['Level']>$mulai_level) {//divider } else if (trim($amodul[$i]['Menu'])=="-" && $amodul[$i]['Level']>$mulai_level) {//divider
$thasil .= '<li class="dropdown-divider"></li>'; $thasil .= '<li class="dropdown-divider"></li>';
} else if ($amodul[$i]['Level']==$mulai_level) {//level = 1 + no submenu } else if ($amodul[$i]['Level']==$mulai_level) {//level = 1 + no submenu
$thasil .= '<li class="nav-item pe-3"><a class="nav-link mlink" id="'.$amodul[$i]['Kode'].'Link" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a></li>'; $thasil .= '<li class="nav-item pe-4"><a class="nav-link mlink" id="'.$amodul[$i]['Kode'].'Link" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a></li>';
} else {// level > 1 + no submenu } else {// level > 1 + no submenu
$thasil .= '<li><a class="dropdown-item mlink" id="'.$amodul[$i]['Kode'].'Link" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a></li>'; $thasil .= '<li><a class="dropdown-item mlink" id="'.$amodul[$i]['Kode'].'Link" title="'.$amodul[$i]['Judul'].'">'.$ticon.$amodul[$i]['Menu'].'</a></li>';
} }
+1 -1
View File
@@ -25,7 +25,7 @@ final class Register {
} }
static public function reg_id() { static public function reg_id() {
$id = $_SESSION['__WEB_APP']['REG_ID']; $id = $_SESSION['__WEB_APP']['REG_ID'] ?? "";
return (substr($id,0,3).".".substr($id,3,3).".".substr($id,6)); return (substr($id,0,3).".".substr($id,3,3).".".substr($id,6));
} }